Skip to content

Commit

Permalink
TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jun 12, 2023
1 parent fb34cc3 commit a4bc1f8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ protected Object autoloadConstant(

// Mark the autoload constant as loading already here and not in RequireNode so that recursive lookups act as "being loaded"
autoloadConstantStart(getContext(), constant, this);
// TODO return early for other threads if the constant has been set
try {
try {
callRequireNode.call(coreLibrary().mainObject, "require", feature);
} finally {
if (autoloadConstant.shouldPublish()) {
autoloadConstant.publish(getContext(), constant);
}
} // TODO else remove the constant
}

// This needs to run while the autoload is marked as isAutoloading(), to avoid infinite recursion
Expand All @@ -149,6 +150,7 @@ public static void autoloadConstantStart(RubyContext context, RubyConstant autol
// We need to notify cached lookup that we are autoloading the constant, as constant
// lookup changes based on whether an autoload constant is loading or not (constant
// lookup ignores being-autoloaded constants).
// TODO skip if already has unpublishedValue
autoloadConstant.getDeclaringModule().fields.newConstantVersion(autoloadConstant.getName());
}

Expand Down

0 comments on commit a4bc1f8

Please sign in to comment.