summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-30 12:22:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-30 12:22:17 +0000
commitc683096c90a0690f7e5c95f5e3e3f3e775bea08d (patch)
treedbe0065cfb17d094989d5856cb902cca4bd146f4 /class.c
parentadf511efc635e53272dc2ce9094d1a579fa2ff3c (diff)
vm_insnhelper.c: keyword hash functions
* vm_insnhelper.c (rb_extract_keywords, rb_check_keyword_opthash): extract from vm_callee_setup_keyword_arg. * class.c (rb_scan_args): check if keys of keyword hash are symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/class.c b/class.c
index 8d23798..2bd6bb3 100644
--- a/class.c
+++ b/class.c
@@ -1786,8 +1786,11 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
}
else {
hash = rb_check_hash_type(last);
- if (!NIL_P(hash))
- argc--;
+ if (!NIL_P(hash)) {
+ VALUE opts = rb_extract_keywords(&hash);
+ if (!hash) argc--;
+ hash = opts;
+ }
}
}
/* capture leading mandatory arguments */