vm_call_opt_send should not drop the empty keyword hash

Now the mechanism that conveys kw_splat flag is gradually established,
so the hack to drop the empty keyword hash is not needed for
vm_call_opt_send.
This commit is contained in:
Yusuke Endoh 2019-09-05 18:54:26 +09:00 коммит произвёл Jeremy Evans
Родитель 4615886c76
Коммит 252e299009
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -465,7 +465,9 @@ class TestKeywordArguments < Test::Unit::TestCase
[arg, args]
end
assert_raise(ArgumentError) { c.send(:m, **{}) }
assert_raise(ArgumentError) { c.send(:m, **kw) }
assert_warn(/The keyword argument is passed as the last hash parameter.* for `m'/m) do
assert_equal([kw, kw], c.send(:m, **kw))
end
assert_warn(/The keyword argument is passed as the last hash parameter.* for `m'/m) do
assert_equal([h, kw], c.send(:m, **h))
end
@ -640,7 +642,6 @@ class TestKeywordArguments < Test::Unit::TestCase
[arg, args]
end
assert_raise(ArgumentError) { c.m(**{}) }
assert_raise(ArgumentError) { c.send(:m, **kw) } # XXX: fix it after the commit
assert_warn(/The keyword argument is passed as the last hash parameter.* for `method_missing'/m) do
assert_equal([kw, kw], c.m(**kw))
end

Просмотреть файл

@ -2309,7 +2309,7 @@ vm_call_opt_send(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, struct
struct rb_call_info_with_kwarg ci_entry;
struct rb_call_cache cc_entry, *cc;
CALLER_SETUP_ARG(reg_cfp, calling, orig_ci, 1);
CALLER_SETUP_ARG(reg_cfp, calling, orig_ci, 0);
i = calling->argc - 1;