Skip to content

Commit

Permalink
Fix potential edgecase with top-level await from 20e270d
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Sep 15, 2024
1 parent e9e63e7 commit 4a2db32
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Source/JavaScriptCore/builtins/ModuleLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,12 +637,13 @@ async function requestImportModule(moduleName, referrer, parameters, fetcher)
key = this.resolve(moduleName, referrer, fetcher);
}
var entry = this.ensureRegistered(key);
if (entry.evaluated) {
return this.getModuleNamespaceObject(entry.module);
var mod;
if (entry.evaluated && (mod = entry.module)) {
return this.getModuleNamespaceObject(mod);
}
entry = await this.requestSatisfy(entry, parameters, fetcher, new @Set);
if (entry.evaluated) {
return this.getModuleNamespaceObject(entry.module);
if (entry.evaluated && (mod = entry.module)) {
return this.getModuleNamespaceObject(mod);
}
await this.linkAndEvaluateModule(entry.key, fetcher);
return this.getModuleNamespaceObject(entry.module);
Expand Down

0 comments on commit 4a2db32

Please sign in to comment.