mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019.
The code is not useless. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
233f7d09e3
commit
284d746392
3 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Jun 3 03:40:29 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019.
|
||||||
|
The code is not useless.
|
||||||
|
|
||||||
Mon Jun 3 01:25:25 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
|
Mon Jun 3 01:25:25 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
|
||||||
|
|
||||||
* test/socket/test_sockopt.rb: change test name. follow r41037.
|
* test/socket/test_sockopt.rb: change test name. follow r41037.
|
||||||
|
|
|
@ -379,4 +379,15 @@ class TestRubyYieldGen < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_block_with_mock
|
||||||
|
y = Object.new
|
||||||
|
def y.s(a)
|
||||||
|
yield(a)
|
||||||
|
end
|
||||||
|
m = Object.new
|
||||||
|
def m.method_missing(*a)
|
||||||
|
super
|
||||||
|
end
|
||||||
|
assert_equal [m, nil], y.s(m){|a,b|[a,b]}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2211,6 +2211,9 @@ vm_yield_setup_block_args(rb_thread_t *th, const rb_iseq_t * iseq,
|
||||||
|
|
||||||
MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
|
MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
argv[0] = arg0; /* rb_check_array_type(arg0) may change argv */
|
||||||
|
}
|
||||||
|
|
||||||
/* keyword argument */
|
/* keyword argument */
|
||||||
if (iseq->arg_keyword != -1) {
|
if (iseq->arg_keyword != -1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue