Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyModule.java
Original file line number Diff line number Diff line change
@@ -2810,15 +2810,15 @@ public RubyBoolean const_defined_p19(ThreadContext context, IRubyObject[] args)
while((sep = symbol.indexOf("::")) != -1) {
String segment = symbol.substring(0, sep);
symbol = symbol.substring(sep + 2);
IRubyObject obj = mod.getConstantNoConstMissing(validateConstant(segment, args[0]), inherit, inherit);
IRubyObject obj = mod.fetchConstant(validateConstant(segment, args[0]), false);
if(obj instanceof RubyModule) {
mod = (RubyModule)obj;
} else {
throw runtime.newTypeError(segment + " does not refer to class/module");
}
}

return runtime.newBoolean(mod.getConstantNoConstMissing(validateConstant(symbol, args[0]), inherit, inherit) != null);
return runtime.newBoolean(mod.fetchConstant(validateConstant(symbol, args[0]), false) != null);
}

/** rb_mod_const_get

0 comments on commit 496c638

Please sign in to comment.