[macruby-changes] [3370] MacRuby/trunk/variable.c
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jan 29 17:25:56 PST 2010
Revision: 3370
http://trac.macosforge.org/projects/ruby/changeset/3370
Author: lsansonetti at apple.com
Date: 2010-01-29 17:25:56 -0800 (Fri, 29 Jan 2010)
Log Message:
-----------
fixed an autoload bug from a mixed module
Modified Paths:
--------------
MacRuby/trunk/variable.c
Modified: MacRuby/trunk/variable.c
===================================================================
--- MacRuby/trunk/variable.c 2010-01-29 23:40:14 UTC (rev 3369)
+++ MacRuby/trunk/variable.c 2010-01-30 01:25:56 UTC (rev 3370)
@@ -56,6 +56,8 @@
0, retain_cb, release_cb, NULL, NULL
};
+static SEL selRequire = 0;
+
void
Init_var_tables(void)
{
@@ -66,6 +68,7 @@
autoload = rb_intern("__autoload__");
classpath = rb_intern("__classpath__");
tmp_classpath = rb_intern("__tmp_classpath__");
+ selRequire = sel_registerName("require:");
}
struct fc_result {
@@ -1483,6 +1486,11 @@
if (!load || !(file = load->nd_lit)) {
return Qfalse;
}
+ if (false) {
+ // XXX Apparently RubySpec does not want us to do that...
+ return rb_vm_call(*(VALUE *)rb_mKernel, selRequire, 1, &file,
+ false);
+ }
return rb_require_safe(file, load->nd_nth);
}
@@ -1569,7 +1577,7 @@
if (!RTEST(rb_autoload_load(tmp, id))) {
break;
}
- continue;
+ goto retry;
}
if (exclude && tmp == rb_cObject && klass != rb_cObject) {
rb_warn("toplevel constant %s referenced by %s::%s",
@@ -1593,7 +1601,7 @@
if (!RTEST(rb_autoload_load(mod, id))) {
break;
}
- continue;
+ goto retry;
}
return rb_vm_resolve_const_value(value, klass, id);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100129/d2bec808/attachment.html>
More information about the macruby-changes
mailing list