Skip to content

Commit fb88001

Browse files
authored
Avoid use of dependenciesFulfilled in emscripten_lazy_load_code. NFC (#24916)
Even though the lazy loading code is due to be removed I'm trying to cleanup usages of the `dependenciesFulfilled` system.
1 parent 43baa09 commit fb88001

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/lib/libasync.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,8 @@ addToLibrary({
551551
emscripten_lazy_load_code: () => Asyncify.handleSleep((wakeUp) => {
552552
// Update the expected wasm binary file to be the lazy one.
553553
wasmBinaryFile += '.lazy.wasm';
554-
// Add a callback for when all run dependencies are fulfilled, which happens when async wasm loading is done.
555-
dependenciesFulfilled = wakeUp;
556-
// Load the new wasm.
557-
createWasm();
554+
// Load the new wasm. The resulting Promise will resolve once the async loading is done.
555+
createWasm().then(() => wakeUp());
558556
}),
559557
#endif
560558

0 commit comments

Comments
 (0)