Testing plan for Thenable-Curtailment (Safe Promise Resolve)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
- Domain
- testing-qa
Research direction
Start by reading the Thenable-Curtailment proposal at https://tc39.es/proposal-thenable-curtailment/ and determine how the test262 setup can expose a safeResolvePromise host-defined function. Work through the listed synchronous, deferred, latching, and edge-case scenarios. Done means the setup and listed behaviors are covered by conformance tests, including rejection, deferral, and promise-latching behavior.
Written by the indexing model from the issue text.
Description
Testing Plan for https://tc39.es/proposal-thenable-curtailment/
Setup:
- Add a
safeResolvePromisehost-defined function to allow testing the proposal (which otherwise has no user access in its current shape)
Synchronous Resolve
- Primitive values resolve synchronously
- Object with no
thenproperty resolve synchronously - Object with un-callable
thenresolve synchronously. - Object with un-callable
thenon prototype resolves synchronously - Object with
thensetter, but no getter, resolve synchronously - Object with
thensetter, but no getter, on the prototype. resolves synchronously. - Object with own-property then which is not callable shadows a callable then, resolves synchronously.
Deferred Resolve & Execution of User Code
- Resolving with a
Proxy(even with empty traps) resolves deferred. - Resolving with a Proxy with a
gettrap is resolved.- The get trap runs in deferral.
- Resolving an object which has a proxy on its prototype chain is deferred.
- Resolving with a module namespace object is deferred
- Object with callable
thenown-property is deferred- The
thencall is made, deferred.
- The
- Object with callable
thenprototype is deferred- The then call is made deferred
- A deferred
thenthrowing should cause the promise to be rejected. - Object with
thengetter- The then getter is run, deferred.
- Object with
thengetter on prototype. - The then getter is run, deferred.
-
thengetter which throws rejects promise, but deferred - Resolving with a revoked proxy rejects deferred
- Callable Object.prototype.then causes object resolution to be deferred
- unless the object has a null prototype.
- Ensure deferred
thencall has correct this binding. - Tick count of safe resolving a promise with another native promise (resolved, unresolved).
- Delete the callable
thenafter a safeResolve job is enqueued but before it's processed. - Ensure the
Getofthenis run twice when
Latching behaviour
- Attempting to resolve a deferred promise of any sort cannot overwrite or otherwise interfere with the deferred promise
- Late rejection also fails.
- Repeated safe resolution: Latched by first and second is no-op.
- Attempting to safe resolve an already resolved promise is a no-op.
Edge Cases
- (If possible) test HostObjectHasImpureLookupInternalMethods.
- Self-resolve: (note: Spec currently will defer depending on the inspection of current promise.. but I actually think maybe we should change the spec to synchronously throw here?)
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 571
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tc39/test262
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tc39/test262#5190 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tc39/test262#5185 · 7 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tc39/test262#5159 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tc39/test262#5133 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Leonxlnx/taste-skill#216 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
all-contributors/cli#690 ·
Maintainers usually reply within 1 day