[macruby-changes] [3589] MacRuby/trunk/vm_eval.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 23 02:22:36 PST 2010


Revision: 3589
          http://trac.macosforge.org/projects/ruby/changeset/3589
Author:   eloy.de.enige at gmail.com
Date:     2010-02-23 02:22:36 -0800 (Tue, 23 Feb 2010)
Log Message:
-----------
Make sure to set the outer mod to the class of an object, unless it's the main object, when using eval. [Fixes #425].

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

Modified: MacRuby/trunk/vm_eval.c
===================================================================
--- MacRuby/trunk/vm_eval.c	2010-02-23 09:31:31 UTC (rev 3588)
+++ MacRuby/trunk/vm_eval.c	2010-02-23 10:22:36 UTC (rev 3589)
@@ -442,7 +442,12 @@
 	    klass = self;
 	    break;
 	default:
-	    klass = 0;
+	    if (self == rb_vm_top_self()) {
+		klass = 0;
+	    }
+	    else {
+		klass = CLASS_OF(self);
+	    }
 	    break;
     }
     return eval_string(self, klass, src, scope, file, line);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100223/515873fb/attachment-0001.html>


More information about the macruby-changes mailing list