Revision
1153
Author
lsansonetti@apple.com
Date
2009-03-25 18:18:56 -0700 (Wed, 25 Mar 2009)

Log Message

let's be friendler and allow people calling rb_vm_run_under() without self

Modified Paths

Diff

Modified: MacRuby/branches/experimental/roxor.cpp (1152 => 1153)


--- MacRuby/branches/experimental/roxor.cpp	2009-03-26 00:55:06 UTC (rev 1152)
+++ MacRuby/branches/experimental/roxor.cpp	2009-03-26 01:18:56 UTC (rev 1153)
@@ -5917,10 +5917,11 @@
 rb_vm_run_under(VALUE klass, VALUE self, const char *fname, NODE *node)
 {
     assert(klass != 0);
-    assert(self != 0);
 
     VALUE old_top_object = GET_VM()->current_top_object;
-    GET_VM()->current_top_object = self;
+    if (self != 0) {
+	GET_VM()->current_top_object = self;
+    }
     Class old_class = GET_VM()->current_class;
     GET_VM()->current_class = (Class)klass;