Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -47,7 +47,6 @@ public UnresolvedDispatchNode(
this.ignoreVisibility = ignoreVisibility;
this.indirect = indirect;
this.missingBehavior = missingBehavior;
requireNode = KernelNodesFactory.RequireNodeFactory.create(context, getSourceSection(), new RubyNode[]{});
}

@Override
@@ -203,6 +202,11 @@ private Object doRubyBasicObject(
}

if (constant.isAutoload()) {
if (requireNode == null) {
CompilerDirectives.transferToInterpreter();
requireNode = insert(KernelNodesFactory.RequireNodeFactory.create(getContext(), getSourceSection(), new RubyNode[]{}));
}

module.removeConstant(this, (String) methodName);

requireNode.require((RubyString) constant.getValue());

0 comments on commit c68a018

Please sign in to comment.