When providing an instantiateWasm method to the Module, only a successCallback is passed to the method (see docs here)
The problem is that no failureCallback is provided.
In the case of a sync instantiation of the WASM, I can return false if the instantiation fails.
But in the case of an async instantiation, if the instantiation fails, the error isn't properly handled and the page freezes.
I'd like instantiateWasm to take 3 args instead of 2: imports, successCallback and failureCallback.
When providing an
instantiateWasm
method to the Module, only asuccessCallback
is passed to the method (see docs here)The problem is that no
failureCallback
is provided. In the case of a sync instantiation of the WASM, I can returnfalse
if the instantiation fails. But in the case of an async instantiation, if the instantiation fails, the error isn't properly handled and the page freezes.I'd like
instantiateWasm
to take 3 args instead of 2:imports
,successCallback
andfailureCallback
.This means changing this line:
https://github.com/emscripten-core/emscripten/blob/06cebfca51f908d3bc6897113330e45a77010db2/src/preamble.js#L1067
to
Current workaround
For others having the same problem, I'm currently using a dirty hack through
pre-js.js
by doing:And when I instantiate my module:
Version of emscripten/emsdk: emcc 3.1.61