Skip to content

Commit cd7980e

Browse files
committed
add comment about the microtask delay
1 parent 22ec604 commit cd7980e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/wasm/WasmMainTemplatePlugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ class WasmMainTemplatePlugin {
143143
"// object to store loaded and loading wasm modules",
144144
"var installedWasmModules = {};",
145145
"",
146+
// This function is used to delay reading the installed wasm module promises
147+
// by a microtask. Sorting them doesn't help because there are egdecases where
148+
// sorting is not possible (modules splitted into different chunks).
149+
// So we not even trying and solve this by a microtask delay.
146150
"function promiseResolve() { return Promise.resolve(); }",
147151
"",
148152
"var wasmImportObjects = {",

0 commit comments

Comments
 (0)