[前][次][番号順一覧][スレッド一覧]

ruby-changes:32623

From: nobu <ko1@a...>
Date: Sat, 25 Jan 2014 11:16:24 +0900 (JST)
Subject: [ruby-changes:32623] nobu:r44702 (trunk): class.c: allow nil keyword_hash

nobu	2014-01-25 11:16:20 +0900 (Sat, 25 Jan 2014)

  New Revision: 44702

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44702

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/class.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44701)
+++ ChangeLog	(revision 44702)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan 25 11:16:19 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@z...>
 
 	* lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos
Index: class.c
===================================================================
--- class.c	(revision 44701)
+++ class.c	(revision 44702)
@@ -1912,6 +1912,8 @@ rb_get_kwargs(VALUE keyword_hash, const https://github.com/ruby/ruby/blob/trunk/class.c#L1912
      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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]