-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to reject Promise in instantiateWasm #23780
base: main
Are you sure you want to change the base?
Provide a way to reject Promise in instantiateWasm #23780
Conversation
This doesn't change behaviour, just fixes a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Can we get a test for it though. See test_instantiate_wasm
in test_other.py
Sorry I didn't manage to run the test suite locally so I have no idea if my test succeeds. I don't have a lot of time to sink into this :/ Also this PR is changing how those tests work so I probably should wait for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, test failures look valid, but I can't see why this change would break stuff
@@ -166,9 +166,7 @@ Other methods | |||
|
|||
.. js:function:: Module.instantiateWasm | |||
|
|||
When targeting WebAssembly, Module.instantiateWasm is an optional user-implemented callback function that the Emscripten runtime calls to perform the WebAssembly instantiation action. The callback function will be called with two parameters, ``imports`` and ``successCallback``. ``imports`` is a JS object which contains all the function imports that need to be passed to the WebAssembly Module when instantiating, and once instantiated, this callback function should call ``successCallback()`` with the generated WebAssembly Instance object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put Module.instantiateWasm
in double backticks here?
Also, can you wrap these lines at 80 columns?
Module['instantiateWasm'](info, (mod, inst) => { | ||
receiveInstance(mod, inst); | ||
Module['instantiateWasm'](info, (inst, mod) => { | ||
receiveInstance(inst, mod); | ||
resolve(mod.exports); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this needs to be inst.exports
Also fix a typo in parameters name introduced by ec40bc5
Fixes: #23038