mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) r45320,r45321: [Backport #9622]
* vm_insnhelper.c (vm_callee_setup_arg): turn a macro into an inline function. * vm_insnhelper.c (vm_callee_setup_arg): disable fastpath if splat argument, since argc may differ for each calls. [ruby-core:61422] [Bug #9622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5a22835c22
commit
5d2ea90418
4 changed files with 44 additions and 14 deletions
|
@ -16,4 +16,19 @@ class TestCall < Test::Unit::TestCase
|
|||
assert_equal([1, 2, 3, 4], aaa(1, 2, 3, 4))
|
||||
assert_equal([1, 2, 3, 4], aaa(1, *[2, 3, 4]))
|
||||
end
|
||||
|
||||
def test_callinfo
|
||||
bug9622 = '[ruby-core:61422] [Bug #9622]'
|
||||
o = Class.new do
|
||||
def foo(*args)
|
||||
bar(:foo, *args)
|
||||
end
|
||||
def bar(name)
|
||||
name
|
||||
end
|
||||
end.new
|
||||
e = assert_raise(ArgumentError) {o.foo(100)}
|
||||
assert_nothing_raised(ArgumentError) {o.foo}
|
||||
assert_raise_with_message(ArgumentError, e.message, bug9622) {o.foo(100)}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue