From c710449a85cb9a1556264ab1a5dfa1640e1f925a Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 16 Aug 2007 12:07:29 +0000 Subject: [PATCH] fix "&" handling in block parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_yield.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb index b49e3978c5..ef98954d8c 100644 --- a/test/ruby/test_yield.rb +++ b/test/ruby/test_yield.rb @@ -211,11 +211,6 @@ class TestRubyYieldGen < Test::Unit::TestCase params.pop end - if params.last && params.last[0] == '&' - result_binding[params.last[1]] = nil - params.pop - end - star_index = nil params.each_with_index {|par, i| star_index = i if par[0] == '*' @@ -268,12 +263,19 @@ class TestRubyYieldGen < Test::Unit::TestCase #p [:emu0, args, params] + result_binding = {} + + if params.last && params.last[0] == '&' + result_binding[params.last[1]] = nil + params.pop + end + # TRICK #1 : single array argument is expanded if there are two or more params. if args.length == 1 && Array === args[0] && 1 < params.length args = args[0] end - result_binding = emu_bind_params(args, params) + emu_bind_params(args, params, result_binding) #p result_binding result_binding end