Update test262 suite and fix promise combinator non-thenable handling - #2500
Merged
Merged
Conversation
Updates the test262 suite to commit 05bb032907160d66c212589d345fa0e335e2738c, which adds new await-dictionary edge case tests for Promise.allKeyed and Promise.allSettledKeyed. The new ctx-ctor-constructed.js tests exposed a bug: when a custom constructor's resolve method returns a non-thenable value, the combinators invoked "then" via Engine.Invoke, which throws TypeErrorException. That exception type bypasses the catch (JavaScriptException) reject path, so the combinator threw synchronously instead of rejecting the result capability promise as required by IfAbruptRejectPromise. Promise.race had the same latent bug. The fix performs the spec Invoke inline (GetV + IsCallable check + Call) and throws a realm-aware TypeError using the V8-style message, matching how Promise.all, allSettled and any already handle the non-thenable case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lahma
enabled auto-merge (squash)
June 7, 2026 10:25
This was referenced Jun 15, 2026
This was referenced Jun 24, 2026
This was referenced Jul 6, 2026
This was referenced Jul 13, 2026
This was referenced Jul 20, 2026
This was referenced Jul 28, 2026
This was referenced Aug 10, 2026
This was referenced Aug 18, 2026
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.
Updates the test262 suite to commit
05bb0329. The only new upstream commit (tc39/test262#5041) adds failure-case and edge-case tests for theawait-dictionaryproposal (Promise.allKeyed/Promise.allSettledKeyed).Bug exposed by the new tests
The new
ctx-ctor-constructed.jstests failed: when a custom constructor''sresolvemethod returns a non-thenable value,PerformPromiseAllKeyedinvoked"then"viaEngine.Invoke, which throwsTypeErrorException. That exception type bypasses thecatch (JavaScriptException)reject path inPromise.allKeyed/Promise.allSettledKeyed, so the combinator threw synchronously instead of rejecting the result capability promise as required by IfAbruptRejectPromise.Promise.racehad the same latent bug (no test262 coverage for it today, fixed here as well since it is the identical defect).Fix
Perform the spec
Invoke(nextPromise, "then", ...)inline —GetV+IsCallablecheck +Call— and throw a realm-awareTypeErrorwith the V8-stylekCalledNonCallablemessage (undefined is not a function), matching howPromise.all,allSettledandanyalready handle the non-thenable case in this file. UsingGetVkeeps the correct primitive prototype lookup semantics thatEngine.Invokehad.Test results
🤖 Generated with Claude Code