don't crash when using defined?(super) out of a method block
--- MacRuby/trunk/vm.cpp 2010-09-13 21:18:42 UTC (rev 4510)
+++ MacRuby/trunk/vm.cpp 2010-09-13 21:38:09 UTC (rev 4511)
@@ -1605,6 +1605,10 @@
if (type == DEFINED_SUPER) {
klass = RCLASS_SUPER(klass);
}
+ if (what == 0) {
+ rb_raise(rb_eRuntimeError,
+ "defined?(super) out of a method block isn't supported");
+ }
const char *idname = rb_id2name((ID)what);
SEL sel = sel_registerName(idname);