зеркало из https://github.com/github/ruby.git
vm_call_bmethod should not drop the empty keyword hash
Similar to 38e9c1bc35d5549575fbb263afff560e97db068e
This commit is contained in:
Родитель
252e299009
Коммит
70f2780892
|
@ -733,7 +733,9 @@ class TestKeywordArguments < Test::Unit::TestCase
|
|||
define_method(:m) {|arg, **opt| [arg, opt] }
|
||||
end
|
||||
assert_raise(ArgumentError) { c.m(**{}) }
|
||||
assert_raise(ArgumentError) { c.m(**kw) }
|
||||
assert_warn(/The keyword argument is passed as the last hash parameter/m) do
|
||||
assert_equal([kw, kw], c.m(**kw))
|
||||
end
|
||||
assert_warn(/The keyword argument is passed as the last hash parameter/m) do
|
||||
assert_equal([h, kw], c.m(**h))
|
||||
end
|
||||
|
|
|
@ -2279,7 +2279,7 @@ vm_call_bmethod(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_c
|
|||
VALUE *argv;
|
||||
int argc;
|
||||
|
||||
CALLER_SETUP_ARG(cfp, calling, ci, 1);
|
||||
CALLER_SETUP_ARG(cfp, calling, ci, 0);
|
||||
argc = calling->argc;
|
||||
argv = ALLOCA_N(VALUE, argc);
|
||||
MEMCPY(argv, cfp->sp - argc, VALUE, argc);
|
||||
|
|
Загрузка…
Ссылка в новой задаче