diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-07-15 21:25:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-08-03 10:56:50 +0900 |
commit | 4c3140d60f6f94504842a4d0c0d79752a87aec8d (patch) | |
tree | ce3764fc7224b08da01186541550e98d1aaf7cdc /iseq.c | |
parent | 731315bf5520a9ca7c94338c13d10c15b00c78c7 (diff) |
Add keyrest to ruby2_keywords parameters [Bug #18011]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4705
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -3116,9 +3116,18 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc) rb_ary_push(args, a); } } - if (body->param.flags.has_kwrest) { + if (body->param.flags.has_kwrest || body->param.flags.ruby2_keywords) { + ID param; CONST_ID(keyrest, "keyrest"); - rb_ary_push(args, PARAM(keyword->rest_start, keyrest)); + PARAM_TYPE(keyrest); + if (body->param.flags.has_kwrest && + rb_id2str(param = PARAM_ID(keyword->rest_start))) { + rb_ary_push(a, ID2SYM(param)); + } + else if (body->param.flags.ruby2_keywords) { + rb_ary_push(a, ID2SYM(idPow)); + } + rb_ary_push(args, a); } if (body->param.flags.has_block) { CONST_ID(block, "block"); |