Skip to content

Commit

Permalink
Editorial: refactor PerformPromiseThen to allow no capability
Browse files Browse the repository at this point in the history
Fixes tc39#694.
  • Loading branch information
ljharb committed Mar 21, 2018
1 parent 4c2df13 commit 578f37b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -38204,7 +38204,7 @@ <h1>AsyncGeneratorRequest Records</h1>
</tr>
<tr>
<td>[[Capability]]</td>
<td>A PromiseCapability record</td>
<td>A PromiseCapability record, or *undefined*</td>
<td>The promise capabilities associated with this request.</td>
</tr>
</tbody>
Expand Down Expand Up @@ -38739,6 +38739,9 @@ <h1>PromiseReactionJob ( _reaction_, _argument_ )</h1>
1. Assert: _type_ is `"Reject"`.
1. Let _handlerResult_ be ThrowCompletion(_argument_).
1. Else, let _handlerResult_ be Call(_handler_, *undefined*, &laquo; _argument_ &raquo;).
1. If _promiseCapability_ is *undefined*, then
1. Assert: _handlerResult_ is not an abrupt completion.
1. Return NormalCompletion(~empty~);
1. If _handlerResult_ is an abrupt completion, then
1. Let _status_ be Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; _handlerResult_.[[Value]] &raquo;).
1. Else,
Expand Down Expand Up @@ -39095,11 +39098,14 @@ <h1>Promise.prototype.then ( _onFulfilled_, _onRejected_ )</h1>

<!-- es6num="25.4.5.3.1" -->
<emu-clause id="sec-performpromisethen" aoid="PerformPromiseThen">
<h1>PerformPromiseThen ( _promise_, _onFulfilled_, _onRejected_, _resultCapability_ )</h1>
<h1>PerformPromiseThen ( _promise_, _onFulfilled_, _onRejected_ [ , _resultCapability_ ] )</h1>
<p>The abstract operation PerformPromiseThen performs the &ldquo;then&rdquo; operation on _promise_ using _onFulfilled_ and _onRejected_ as its settlement actions. The result is _resultCapability_'s promise.</p>
<emu-alg>
1. Assert: IsPromise(_promise_) is *true*.
1. Assert: _resultCapability_ is a PromiseCapability Record.
1. If _resultCapability_ is present, then
1. Assert: _resultCapability_ is a PromiseCapability Record.
1. Else,
1. Set _resultCapability to *undefined*.
1. If IsCallable(_onFulfilled_) is *false*, then
1. Set _onFulfilled_ to *undefined*.
1. If IsCallable(_onRejected_) is *false*, then
Expand Down

0 comments on commit 578f37b

Please sign in to comment.