@@ -41,20 +41,15 @@ public ReadConstantNode(RubyNode moduleNode, String name) {
41
41
42
42
@ Override
43
43
public Object execute (VirtualFrame frame ) {
44
- final Object moduleObject = moduleNode .execute (frame );
45
- return lookupAndGetConstant (checkModule (moduleObject ));
46
- }
47
-
48
- public Object execute (VirtualFrame frame , RubyModule module , RubyConstant constant ) {
49
- return getConstant (module , constant );
44
+ return lookupAndGetConstant (evaluateModule (frame ));
50
45
}
51
46
52
47
private Object lookupAndGetConstant (RubyModule module ) {
53
48
return getGetConstantNode ()
54
49
.lookupAndResolveConstant (LexicalScope .IGNORE , module , name , getLookupConstantNode ());
55
50
}
56
51
57
- private Object getConstant (RubyModule module , RubyConstant constant ) {
52
+ public Object getConstant (RubyModule module , RubyConstant constant ) {
58
53
return getGetConstantNode ()
59
54
.executeGetConstant (LexicalScope .IGNORE , module , name , constant , getLookupConstantNode ());
60
55
}
@@ -95,7 +90,7 @@ public Object isDefined(VirtualFrame frame, RubyLanguage language, RubyContext c
95
90
final RubyConstant constant = getConstantIfDefined (module );
96
91
return constant == null ? nil : coreStrings ().CONSTANT .createInstance (getContext ());
97
92
} catch (RaiseException e ) {
98
- return nil ; // MRI swallows all exceptions in defined? (MRI Bug# 5786)
93
+ return nil ; // MRI swallows all exceptions in defined? (https://bugs.ruby-lang.org/issues/ 5786)
99
94
}
100
95
}
101
96
0 commit comments