From 45ba4645614ab888fc74e66714b4fc7447e07083 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 2 Dec 2010 08:05:24 +0000 Subject: merges r29335 from trunk into ruby_1_9_2. -- * string.c (sym_call), vm.c (invoke_block_from_c), vm_insnhelper.c (vm_yield_with_cfunc): pass given block. [ruby-core:32075] * vm_eval.c (rb_funcall_passing_block): new function to call method with passing given block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_proc.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 5a108d3a0f..4a1eee3926 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -792,4 +792,22 @@ class TestProc < Test::Unit::TestCase assert_equal([obj, nil], [a, b], '[ruby-core:24139]') end end + + def test_block_propagation + bug3792 = '[ruby-core:32075]' + c = Class.new do + def foo + yield + end + end + + o = c.new + f = :foo.to_proc + assert_nothing_raised(LocalJumpError, bug3792) { + assert_equal('bar', f.(o) {'bar'}, bug3792) + } + assert_nothing_raised(LocalJumpError, bug3792) { + assert_equal('zot', o.method(:foo).to_proc.() {'zot'}, bug3792) + } + end end -- cgit v1.2.3