fix: use correct WebAssembly.instantiate callback signature in wasm/module-wrapper#9720
Merged
kgryte merged 5 commits intostdlib-js:developfrom Jan 25, 2026
Merged
Conversation
Contributor
Author
|
CC @kgryte what do u feel about it ? |
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Contributor
Author
|
modeled the new tests on existing WASM module tests |
kgryte
reviewed
Jan 13, 2026
kgryte
reviewed
Jan 13, 2026
Contributor
Author
|
made the changes @kgryte |
Contributor
Author
|
@kgryte any suggestions or update |
Signed-off-by: Athan <kgryte@gmail.com>
WebAssembly.instantiate callback signature in wasm/module-wrapper
Signed-off-by: Athan <kgryte@gmail.com>
kgryte
approved these changes
Jan 25, 2026
DivitJain26
pushed a commit
to DivitJain26/stdlib-divit
that referenced
this pull request
Feb 25, 2026
…m/module-wrapper` PR-URL: stdlib-js#9720 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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