Skip to content

Add tests for abrupt completion of the then call in NewPromiseResolveThenableJob - #5078

Open
alii wants to merge 3 commits into
tc39:mainfrom
alii:promise-thenable-job-abrupt-then
Open

Add tests for abrupt completion of the then call in NewPromiseResolveThenableJob#5078
alii wants to merge 3 commits into
tc39:mainfrom
alii:promise-thenable-job-abrupt-then

Conversation

@alii

@alii alii commented Jul 2, 2026

Copy link
Copy Markdown

There's no coverage for NewPromiseResolveThenableJob step 1.c (reject the promise when the then call throws). The existing thenable tests only poison the then getter, use a custom then that resolves, or throw after resolving.

The two species tests also catch a real engine bug: JSC never settles the promise when constructor[Symbol.species] throws inside the job (https://bugs.webkit.org/show_bug.cgi?id=318399, fix in WebKit/WebKit#68487). They fail on every current JSC and pass on V8 and on JSC trunk with that fix. The other two pass everywhere and just fill the coverage gap.

@alii
alii requested a review from a team as a code owner July 2, 2026 07:34
…ThenableJob

There's no coverage for NewPromiseResolveThenableJob step 1.c (reject the
promise when the then call throws). The existing thenable tests only poison
the then getter, use a custom then that resolves, or throw after resolving.

The two species tests also catch a real engine bug: JSC never settles the
promise when constructor[Symbol.species] throws inside the job
(https://bugs.webkit.org/show_bug.cgi?id=318399, fix in
WebKit/WebKit#68487). They fail on every current JSC
and pass on V8 and on JSC trunk with that fix. The other two pass everywhere
and just fill the coverage gap.
@alii
alii force-pushed the promise-thenable-job-abrupt-then branch from d48f118 to 0f85eb6 Compare July 2, 2026 07:35
@ptomato

ptomato commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Thanks! You may want to consider using the asyncHelpers harness (https://github.com/tc39/test262/blob/main/rfcs/async-helpers.md) to see if that makes these tests any simpler.

@alii

alii commented Aug 10, 2026

Copy link
Copy Markdown
Author

Thank you! Updated to use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants