Skip to content

Commit

Permalink
const_defined? should not trigger autoload.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jan 14, 2015
1 parent 73d5f0f commit 496c638
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
Expand Up @@ -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
Expand Down

0 comments on commit 496c638

Please sign in to comment.