Reject a module's own capability before its async parents - #1647
Open
andreasrosdal wants to merge 2 commits into
Open
Reject a module's own capability before its async parents#1647andreasrosdal wants to merge 2 commits into
andreasrosdal wants to merge 2 commits into
Conversation
AsyncModuleExecutionRejected rejects the module's own [[TopLevelCapability]]
first and only then recurses into [[AsyncParentModules]], so the top-level
promises of a failing graph settle leaf-to-root:
9. If module.[[TopLevelCapability]] is not empty, then
b. Perform ! Call(module.[[TopLevelCapability]].[[Reject]], ...).
10. For each Cyclic Module Record m of module.[[AsyncParentModules]], do
a. Perform AsyncModuleExecutionRejected(m, error).
js_async_module_execution_rejected() runs those two steps the other way
round, so an importer of the failing module is rejected before the module
itself. Swap them.
Fixes test262 language/module-code/top-level-await/rejection-order.js, which
is listed in test262_errors.txt; drop the entry.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014mv33YvfHz7t9mmkituBnn
A three module chain, each link imported in its own right so that each one has a top level capability, makes the order observable: rejecting the module's own capability before recursing into its async parents settles the chain leaf first, and doing it the other way around settles it in reverse. Also checks that every module in the chain reports the identical error object, that re-importing a failed module keeps reporting it, and that two independent ancestors of one failing leaf are both notified. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K6eRbuuuCujKgQkrHgvMrc
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.
AsyncModuleExecutionRejectedrejects the module's own[[TopLevelCapability]]first and only then recurses into[[AsyncParentModules]], so the top-level promises of a failing graph settle leaf-to-root:js_async_module_execution_rejected()runs those two steps the other way round, so an importer of the failing module is rejected before the module itself. Swap them.Fixes
test262/test/language/module-code/top-level-await/rejection-order.js, which is listed intest262_errors.txt; the entry is dropped.🤖 Generated with Claude Code
https://claude.ai/code/session_014mv33YvfHz7t9mmkituBnn
Generated by Claude Code