Skip to content

Commit

Permalink
Optimize already-evaluated dynamic imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Sep 14, 2024
1 parent 4db9137 commit 20e270d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/JavaScriptCore/builtins/ModuleLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,14 @@ async function requestImportModule(moduleName, referrer, parameters, fetcher)
await importMap;
key = this.resolve(moduleName, referrer, fetcher);
}
var entry = await this.requestSatisfy(this.ensureRegistered(key), parameters, fetcher, new @Set);
var entry = this.ensureRegistered(key);
if (entry.evaluated) {
return this.getModuleNamespaceObject(entry.module);
}
entry = await this.requestSatisfy(entry, parameters, fetcher, new @Set);
if (entry.evaluated) {
return this.getModuleNamespaceObject(entry.module);
}
await this.linkAndEvaluateModule(entry.key, fetcher);
return this.getModuleNamespaceObject(entry.module);
}
Expand Down

0 comments on commit 20e270d

Please sign in to comment.