Skip to content

Conversation

takikawa
Copy link
Contributor

@takikawa takikawa commented Sep 10, 2025

When the dummy import used in the test is missing, the first step in "read the imports" in the JS API will cause a TypeError to be thrown when run in a browser implementation. But the test expects a link error instead due to using assert_unlinkable so the test ends up failing.

This PR changes the dummy import in the test so it's an invalid import with the wrong type, which should produce a link error as desired, and lets the test succeed with JS hosts.

When the import is missing, the "read the imports" step in
the JS API will cause a TypeError to be thrown instead of
a link error. Changing the condition to an invalid import
with the wrong type causes a LinkError to be thrown instead,
which allows the use of assert_unlinkable.
Copy link
Collaborator

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fitzgen fitzgen merged commit cad80dc into WebAssembly:main Sep 11, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants