Skip to content

Commit

Permalink
Normative: add Promise.withResolvers (tc39#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
peetklecha authored and ljharb committed Dec 4, 2023
1 parent 3a9c9dc commit 11cbf72
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -47029,6 +47029,20 @@ <h1>
</emu-clause>
</emu-clause>

<emu-clause id="sec-promise.withResolvers">
<h1>Promise.withResolvers ( )</h1>
<p>This function returns an object with three properties: a new promise together with the `resolve` and `reject` functions associated with it.</p>
<emu-alg>
1. Let _C_ be the *this* value.
1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_obj_, *"promise"*, _promiseCapability_.[[Promise]]).
1. Perform ! CreateDataPropertyOrThrow(_obj_, *"resolve"*, _promiseCapability_.[[Resolve]]).
1. Perform ! CreateDataPropertyOrThrow(_obj_, *"reject"*, _promiseCapability_.[[Reject]]).
1. Return _obj_.
</emu-alg>
</emu-clause>

<emu-clause id="sec-get-promise-@@species">
<h1>get Promise [ @@species ]</h1>
<p>`Promise[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:</p>
Expand Down

0 comments on commit 11cbf72

Please sign in to comment.