Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Source/JavaScriptCore/runtime/JSMicrotask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ static void moduleRegistryModuleSettled(JSGlobalObject* globalObject, VM& vm, st
auto* entry = uncheckedDowncast<ModuleRegistryEntry>(arguments[2]);
auto* modulePromise = uncheckedDowncast<JSPromise>(arguments[0]);
auto status = static_cast<JSPromise::Status>(payload);
#if USE(BUN_JSC_ADDITIONS)
// hostLoadImportedModule's synchronous re-entry path may have already
// called fetchComplete() and fulfilled modulePromise inline while a
// synchronous loadModule was active, leaving this queued copy redundant.
// The inline path creates its own module record; the one we'd provide
// here is a duplicate parse of the same source that nothing references.
if (modulePromise->status() != JSPromise::Status::Pending)
return;
#endif
if (status == JSPromise::Status::Fulfilled) {
auto* moduleRecord = downcast<AbstractModuleRecord>(arguments[1]);
entry->fetchComplete(globalObject, moduleRecord);
Expand Down