-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: use correct WebAssembly.instantiate callback signature in wasm/module-wrapper
#9720
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
fix: use correct WebAssembly.instantiate callback signature in wasm/module-wrapper
#9720
Conversation
|
CC @kgryte what do u feel about it ? |
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
modeled the new tests on existing WASM module tests |
kgryte
left a comment
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.
Let initial comments.
|
made the changes @kgryte |
|
@kgryte any suggestions or update |
Signed-off-by: Athan <kgryte@gmail.com>
kgryte
left a comment
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
WebAssembly.instantiate callback signature in wasm/module-wrapper
Signed-off-by: Athan <kgryte@gmail.com>
Description
Related Issues
This pull request has no related issues.
Bug Impact
The bug caused
this._instanceto beundefinedafter async initialization, breaking all WebAssembly operations that depend on instance exports. Any code usinginitialize()orinitializeAsync()would fail when trying to accessthis._instance.exports.*.Technical Details
The
WebAssembly.instantiate()API returnsPromise<{module: WebAssembly.Module, instance: WebAssembly.Instance}>. The previous implementation incorrectly destructured this as two separate parameters in the Promise.then()callback, which only receives a single argument.Testing
All new tests pass and verify:
_moduleand_instanceare correctly set after initializationWebAssembly.ModuleandWebAssembly.Instancerespectivelyexportsproperty is accessible after initializationChecklist
AI Assistance
@stdlib-js/reviewers