diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-17 03:37:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-17 03:37:47 +0000 |
commit | d689dca633e979bb888a6a287a07e0084a0f5187 (patch) | |
tree | 09f909688088f714b26e2c9bbf246eb2d6a78a8e /eval.c | |
parent | b905ac81a07bd6547f353ea30c163b47ac60b27d (diff) | |
download | ruby-d689dca633e979bb888a6a287a07e0084a0f5187.tar.gz |
eval.c: pass unknown options
* eval.c (extract_raise_opts): pass unknown options to the
exception, so that exception class can receive a hash argument.
[ruby-core:63203] [Feature #8257]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -606,12 +606,11 @@ extract_raise_opts(int argc, VALUE *argv, VALUE *opts) if (argc > 0) { VALUE opt = argv[argc-1]; if (RB_TYPE_P(opt, T_HASH)) { - VALUE kw = rb_extract_keywords(&opt); - if (!opt) --argc; - if (kw) { + if (!RHASH_EMPTY_P(opt)) { ID keywords[1]; CONST_ID(keywords[0], "cause"); - rb_get_kwargs(kw, keywords, 0, 1, opts); + rb_get_kwargs(opt, keywords, 0, -1-raise_max_opt, opts); + if (RHASH_EMPTY_P(opt)) --argc; return argc; } } |