Skip to content

[await-dictionary] add failure case and edge case tests#1

Closed
danialasaria wants to merge 2 commits into
mainfrom
dasaria/await-dictionary-keyed-failure-edge-tests
Closed

[await-dictionary] add failure case and edge case tests#1
danialasaria wants to merge 2 commits into
mainfrom
dasaria/await-dictionary-keyed-failure-edge-tests

Conversation

@danialasaria
Copy link
Copy Markdown
Owner

@danialasaria danialasaria commented Apr 29, 2026

Summary

This PR adds the remaining failure-case and edge-case coverage for the await-dictionary proposal's Promise keyed combinators:

  • Promise.allKeyed
  • Promise.allSettledKeyed

It follows the runtime/behavioral tests PR (tc39#4932) and completes the testing plan from tc39#4886.

What this PR covers

NewPromiseCapability failures (sync throws)

  • Constructor body throws (ctx-ctor-throws.js)
  • Executor does not provide callable resolve/reject in various combinations (capability-executor-not-callable.js)

GetPromiseResolve failures (async rejections)

  • Get(constructor, "resolve") accessor throws (invoke-resolve-get-error-reject.js)
  • Calling the resolved promiseResolve function throws (invoke-resolve-error-reject.js)

allKeyed rejection ordering

  • Second promise to settle is rejected (reject-second.js)
  • Last promise to settle is rejected (reject-last.js)

Synchronous thenables (step 8 edge case)

  • Thenables that synchronously invoke onFulfilled during the loop, causing remainingElementsCount to reach zero before the loop exits (resolve-before-loop-exit.js)

Exotic object abrupt completions (Proxy)

  • [[OwnPropertyKeys]] throws (ownkeys-throws.js)
  • [[GetOwnProperty]] throws (getownproperty-throws.js)
  • [[GetOwnProperty]] returns undefined -- key is skipped (getownproperty-returns-undefined.js)

Notes

What this PR does not cover

This completes all items from the testing plan (tc39#4886). No remaining items.

References

Cover remaining items from the testing plan (tc39#4886):

- NewPromiseCapability: constructor throws, executor not callable
- GetPromiseResolve: Get accessor throws
- promiseResolve call throws during iteration
- allKeyed rejection ordering (2nd and last to settle)
- Synchronous thenables hitting remainingElementsCount step 8
- Exotic object: [[OwnPropertyKeys]] throws
- Exotic object: [[GetOwnProperty]] throws
- Exotic object: [[GetOwnProperty]] returns undefined (key skipped)
- capability-executor-not-callable: add Object.defineProperty poison on
  'resolve' to detect wrong evaluation order, add fn6 case (Number, String)
- invoke-then-error-reject: new test for Invoke(nextPromise, "then") throwing
- invoke-then-get-error-reject: new test for Get(nextPromise, "then") throwing
- resolve-before-loop-exit: switch Object.keys to Reflect.ownKeys
- getownproperty-not-enumerable: new test for non-enumerable keys being skipped
@danialasaria
Copy link
Copy Markdown
Owner Author

Superseded by tc39#5041

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.

1 participant