зеркало из https://github.com/github/ruby.git
class.c: allow nil keyword_hash
* class.c (rb_extract_keywords): treat nil keyword_hash same as 0, for the case rb_scan_args returns nil if no keyword hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6a634322e6
Коммит
bbba022739
|
@ -1,3 +1,8 @@
|
|||
Sat Jan 25 11:16:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* class.c (rb_extract_keywords): treat nil keyword_hash same as 0,
|
||||
for the case rb_scan_args returns nil if no keyword hash.
|
||||
|
||||
Fri Jan 24 15:13:20 2014 Zachary Scott <e@zzak.io>
|
||||
|
||||
* lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos
|
||||
|
|
2
class.c
2
class.c
|
@ -1912,6 +1912,8 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
|
|||
st_delete(rb_hash_tbl_raw(keyword_hash), &key, (val)) : \
|
||||
st_lookup(rb_hash_tbl_raw(keyword_hash), key, (val)))
|
||||
|
||||
if (NIL_P(keyword_hash)) keyword_hash = 0;
|
||||
|
||||
if (optional < 0) {
|
||||
rest = 1;
|
||||
optional = -1-optional;
|
||||
|
|
Загрузка…
Ссылка в новой задаче