Repository navigation
[js-api] Validate import resolution in InitializeEnvironment - #130
Merged
Merged
Conversation
ExecuteModule asserts that each import resolves to a ResolvedBinding Record as validated during environment initialization, but no such validation was performed. Resolve each external import when initializing the environment and throw a SyntaxError when the result is null or ambiguous, matching Source Text Module Records.
eqrion
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Nov 23, 2026
Upstreams the tests from WebAssembly/esm-integration#130, covering a WebAssembly module import of a missing or ambiguous export failing to link with a SyntaxError, without evaluating its dependencies.
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Nov 27, 2026
…tion validation tests, a=testonly Automatic update from web-platform-tests [wasm] Add ESM Integration import resolution validation tests Upstreams the tests from WebAssembly/esm-integration#130, covering a WebAssembly module import of a missing or ambiguous export failing to link with a SyntaxError, without evaluating its dependencies. -- wpt-commits: 90c06a918d0a4a718bf62cbef7d03a23a8f44b3d wpt-pr: 65184
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Nov 30, 2026
…tion validation tests, a=testonly Automatic update from web-platform-tests [wasm] Add ESM Integration import resolution validation tests Upstreams the tests from WebAssembly/esm-integration#130, covering a WebAssembly module import of a missing or ambiguous export failing to link with a SyntaxError, without evaluating its dependencies. -- wpt-commits: 90c06a918d0a4a718bf62cbef7d03a23a8f44b3d wpt-pr: 65184 UltraBlame original commit: 0d4e6221e7841cf84e874a6b78d0d89f99a4468d
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Nov 30, 2026
…tion validation tests, a=testonly Automatic update from web-platform-tests [wasm] Add ESM Integration import resolution validation tests Upstreams the tests from WebAssembly/esm-integration#130, covering a WebAssembly module import of a missing or ambiguous export failing to link with a SyntaxError, without evaluating its dependencies. -- wpt-commits: 90c06a918d0a4a718bf62cbef7d03a23a8f44b3d wpt-pr: 65184 UltraBlame original commit: 0d4e6221e7841cf84e874a6b78d0d89f99a4468d
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Nov 30, 2026
…tion validation tests, a=testonly Automatic update from web-platform-tests [wasm] Add ESM Integration import resolution validation tests Upstreams the tests from WebAssembly/esm-integration#130, covering a WebAssembly module import of a missing or ambiguous export failing to link with a SyntaxError, without evaluating its dependencies. -- wpt-commits: 90c06a918d0a4a718bf62cbef7d03a23a8f44b3d wpt-pr: 65184 UltraBlame original commit: 0d4e6221e7841cf84e874a6b78d0d89f99a4468d
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.
This implements validation of WebAssembly module imports when linking, throwing a
SyntaxErrorfor an import that does not resolve.ExecuteModuleasserts that theResolveExportresult for each import is a ResolvedBinding Record "as validated during environment initialization", butInitializeEnvironmentnever performed that validation. A WebAssembly module importing a name that its dependency does not export, or one that is ambiguous between twoexport *declarations, reached that assertion with null or~ambiguous~instead of throwing.InitializeEnvironmentnow resolves each external import and throws aSyntaxErrorwhen the result is null or~ambiguous~, the same way Source Text Module Records do for their import entries:Tests are added to
resolve-export.tentative.any.jsfor an export missing from a JavaScript module, an export missing from a WebAssembly module, and an ambiguous star export. Each also checks that the dependency was not evaluated. The new fixtures are: