[macruby-changes] [3001] MacRuby/trunk/class.c

source_changes at macosforge.org source_changes at macosforge.org
Fri Nov 13 00:02:11 PST 2009


Revision: 3001
          http://trac.macosforge.org/projects/ruby/changeset/3001
Author:   lsansonetti at apple.com
Date:     2009-11-13 00:02:09 -0800 (Fri, 13 Nov 2009)
Log Message:
-----------
don't set a metaclass's outer if the super doesn't have one

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

Modified: MacRuby/trunk/class.c
===================================================================
--- MacRuby/trunk/class.c	2009-11-13 08:01:36 UTC (rev 3000)
+++ MacRuby/trunk/class.c	2009-11-13 08:02:09 UTC (rev 3001)
@@ -410,7 +410,7 @@
     return klass;
 }
 
-    VALUE
+VALUE
 rb_make_metaclass(VALUE obj, VALUE super)
 {
     if (TYPE(obj) == T_CLASS && RCLASS_SINGLETON(obj)) {
@@ -419,7 +419,10 @@
     }
     else {
 	VALUE klass = rb_make_singleton_class(super);
-	rb_vm_set_outer(klass, rb_vm_get_outer(super));
+	VALUE outer = rb_vm_get_outer(super);
+	if (outer != Qundef) {
+	    rb_vm_set_outer(klass, outer);
+	}
 	RBASIC(obj)->klass = klass;
 	rb_singleton_class_attached(klass, obj);
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091113/fc09580c/attachment.html>


More information about the macruby-changes mailing list