mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_insnhelper.c: relax arity check
* vm.c (invoke_block_from_c): add splattable argument. * vm.c (vm_invoke_proc): disallow to splat when directly invoked. * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_callee_setup_arg): relax arity check of yielded lambda. [ruby-core:61340] [Bug #9605] * test/ruby/test_yield.rb (TestRubyYieldGen#emu_bind_params): no longer raise ArgumentError when splatting to lambda. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2deb6e8ee2
commit
163f9abe4f
6 changed files with 173 additions and 16 deletions
|
@ -244,7 +244,7 @@ class TestRubyYieldGen < Test::Unit::TestCase
|
|||
throw :emuerror, ArgumentError
|
||||
end
|
||||
else
|
||||
if args.length != params.length
|
||||
if args.length != params.length and !(args.length == 1 and Array === args[0] and args[0].length == params.length)
|
||||
throw :emuerror, ArgumentError
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue