diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-16 12:07:29 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-16 12:07:29 +0000 |
commit | d25d1186a48f5b8ebba9d117adb4f374d8b81096 (patch) | |
tree | 8742222089fc8d0e8e2541c81818433e836eb990 | |
parent | 17c423938b4c4691bafffe773822297113f87c61 (diff) | |
download | ruby-d25d1186a48f5b8ebba9d117adb4f374d8b81096.tar.gz ruby-d25d1186a48f5b8ebba9d117adb4f374d8b81096.tar.xz ruby-d25d1186a48f5b8ebba9d117adb4f374d8b81096.zip |
fix "&" handling in block parameter.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_yield.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb index b49e3978c..ef98954d8 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 |