Fix: Always set [[ErrorToRethrow]] for import validation errors#11398
Merged
Conversation
domenic
approved these changes
Jun 26, 2025
domenic
left a comment
Member
There was a problem hiding this comment.
Thanks!
For future reference, I think the PR template would still be valuable for cases like this, you'll just be able to check all the boxes easily. Especially verifying that this behavior is WPT-tested is nice. (But I guess the linked issue lets people do that without much work.)
This is in preparation for fixing whatwg#11338, which will expand its usage from pure parsing errors to also specifier resolution errors and import attribute validation errors.
Fixes whatwg#11338. This regressed in 430582c. Now the window error event, instead of the script element error event, will be fired for specifier resolution errors and import attribute validation errors, as it was prior to that commit.
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.
(deleting the template as this PR updates the spec text to match the intended behavior and the WPT tests)
Fixes #11338
The errors that do not set [[ErrorToRethrow]] are now the ones when:
While the following errors do set it:
Which I believe matches the original behavior.
I think I will follow up with a small editorial PR to use the ThrowCompletion AO from ECMA-262 when creating throw completions to pass to FinishLoadingImportedModule, rather than manually creating them.
/webappapis.html ( diff )