[macruby-changes] [2377] MacRuby/trunk/hash.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 25 14:12:18 PDT 2009


Revision: 2377
          http://trac.macosforge.org/projects/ruby/changeset/2377
Author:   lsansonetti at apple.com
Date:     2009-08-25 14:12:15 -0700 (Tue, 25 Aug 2009)
Log Message:
-----------
Hash#initialize: check if receiver can be modified

Modified Paths:
--------------
    MacRuby/trunk/hash.c

Modified: MacRuby/trunk/hash.c
===================================================================
--- MacRuby/trunk/hash.c	2009-08-25 21:09:17 UTC (rev 2376)
+++ MacRuby/trunk/hash.c	2009-08-25 21:12:15 UTC (rev 2377)
@@ -287,7 +287,7 @@
 static VALUE
 rb_hash_initialize(VALUE hash, SEL sel, int argc, const VALUE *argv)
 {
-    VALUE ifnone;
+    rb_hash_modify(hash);
 
     hash = (VALUE)objc_msgSend((id)hash, selInit);
 
@@ -298,6 +298,7 @@
 	rb_objc_hash_set_struct(hash, rb_block_proc(), true);
     }
     else {
+	VALUE ifnone;
 	rb_scan_args(argc, argv, "01", &ifnone);
 	if (ifnone != Qnil)
 	    rb_objc_hash_set_struct(hash, ifnone, false);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090825/53cd4a89/attachment.html>


More information about the macruby-changes mailing list