[macruby-changes] [2291] MacRuby/trunk/vm.cpp

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 11 19:29:21 PDT 2009


Revision: 2291
          http://trac.macosforge.org/projects/ruby/changeset/2291
Author:   lsansonetti at apple.com
Date:     2009-08-11 19:29:21 -0700 (Tue, 11 Aug 2009)
Log Message:
-----------
make sure Array.new always returns a RubyArray

Modified Paths:
--------------
    MacRuby/trunk/vm.cpp

Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp	2009-08-12 02:28:48 UTC (rev 2290)
+++ MacRuby/trunk/vm.cpp	2009-08-12 02:29:21 UTC (rev 2291)
@@ -2610,6 +2610,11 @@
 	    rb_warn("passing a block to an Objective-C method - " \
 		    "will be ignored");
 	}
+	else if (sel == selNew) {
+	    if (self == rb_cNSMutableArray) {
+		self = rb_cRubyArray;
+	    }
+	}
 	else if (sel == selClass) {
 	    // Because +[NSObject class] returns self.
 	    if (RCLASS_META(klass)) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090811/014302aa/attachment.html>


More information about the macruby-changes mailing list