From 8c8d666467eb3f94920592f63f56d1d4354350a0 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 15 Dec 2008 07:26:48 +0000 Subject: * vm_insnhelper.c (vm_callee_setup_arg_complex): uses cfp from blockptr instead of the current cfp. [ruby-core:20544] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_block.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb index 2db149063e..ce7f00b033 100644 --- a/bootstraptest/test_block.rb +++ b/bootstraptest/test_block.rb @@ -486,6 +486,24 @@ assert_equal 'ok', %q{ C.new.foo("ng") {"ok"} }, '[ruby-talk:266422]' +assert_equal 'ok', %q{ + class C + define_method(:xyz) do |o, k, &block| + block.call(o, k) + end + end + C.new.xyz("o","k") {|o, k| o+k} +}, '[ruby-core:20544]' + +assert_equal 'ok', %q{ + class C + define_method(:xyz) do |*args, &block| + block.call(*args) + end + end + C.new.xyz("o","k") {|*args| args.join("")} +}, '[ruby-core:20544]' + assert_equal 'ok', %q{ STDERR.reopen(STDOUT) class C -- cgit v1.2.3