Skip to content

Commit a4bc1f8

Browse files
committed
TODOs
1 parent fb34cc3 commit a4bc1f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/truffleruby/language/constants/GetConstantNode.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ protected Object autoloadConstant(
125125

126126
// Mark the autoload constant as loading already here and not in RequireNode so that recursive lookups act as "being loaded"
127127
autoloadConstantStart(getContext(), constant, this);
128+
// TODO return early for other threads if the constant has been set
128129
try {
129130
try {
130131
callRequireNode.call(coreLibrary().mainObject, "require", feature);
131132
} finally {
132133
if (autoloadConstant.shouldPublish()) {
133134
autoloadConstant.publish(getContext(), constant);
134-
}
135+
} // TODO else remove the constant
135136
}
136137

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

0 commit comments

Comments
 (0)