Skip to content

Commit

Permalink
Editorial: Simplify Promise.all and Promise.any
Browse files Browse the repository at this point in the history
  • Loading branch information
chicoxyzzy committed Oct 30, 2020
1 parent 35a7d35 commit ee71702
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -39894,7 +39894,7 @@ <h1>PerformPromiseAll ( _iteratorRecord_, _constructor_, _resultCapability_, _pr
1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, &laquo; _nextValue_ &raquo;).
1. Let _steps_ be the algorithm steps defined in <emu-xref href="#sec-promise.all-resolve-element-functions" title></emu-xref>.
1. Let _resolveElement_ be ! CreateBuiltinFunction(_steps_, &laquo; [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] &raquo;).
1. Set _resolveElement_.[[AlreadyCalled]] to the Record { [[Value]]: *false* }.
1. Set _resolveElement_.[[AlreadyCalled]] to *false*.
1. Set _resolveElement_.[[Index]] to _index_.
1. Set _resolveElement_.[[Values]] to _values_.
1. Set _resolveElement_.[[Capability]] to _resultCapability_.
Expand All @@ -39911,9 +39911,8 @@ <h1>`Promise.all` Resolve Element Functions</h1>
<p>When a `Promise.all` resolve element function is called with argument _x_, the following steps are taken:</p>
<emu-alg>
1. Let _F_ be the active function object.
1. Let _alreadyCalled_ be _F_.[[AlreadyCalled]].
1. If _alreadyCalled_.[[Value]] is *true*, return *undefined*.
1. Set _alreadyCalled_.[[Value]] to *true*.
1. If _F_.[[AlreadyCalled]]. is *true*, return *undefined*.
1. Set _F_.[[AlreadyCalled]] to *true*.
1. Let _index_ be _F_.[[Index]].
1. Let _values_ be _F_.[[Values]].
1. Let _promiseCapability_ be _F_.[[Capability]].
Expand Down Expand Up @@ -40096,7 +40095,7 @@ <h1>PerformPromiseAny ( _iteratorRecord_, _constructor_, _resultCapability_, _pr
1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, &laquo; _nextValue_ &raquo;).
1. Let _steps_ be the algorithm steps defined in <emu-xref href="#sec-promise.any-reject-element-functions" title></emu-xref>.
1. Let _rejectElement_ be ! CreateBuiltinFunction(_steps_, &laquo; [[AlreadyCalled]], [[Index]], [[Errors]], [[Capability]], [[RemainingElements]] &raquo;).
1. Set _rejectElement_.[[AlreadyCalled]] to the Record { [[Value]]: *false* }.
1. Set _rejectElement_.[[AlreadyCalled]] to *false*.
1. Set _rejectElement_.[[Index]] to _index_.
1. Set _rejectElement_.[[Errors]] to _errors_.
1. Set _rejectElement_.[[Capability]] to _resultCapability_.
Expand All @@ -40113,9 +40112,8 @@ <h1>`Promise.any` Reject Element Functions</h1>
<p>When a `Promise.any` reject element function is called with argument _x_, the following steps are taken:</p>
<emu-alg>
1. Let _F_ be the active function object.
1. Let _alreadyCalled_ be _F_.[[AlreadyCalled]].
1. If _alreadyCalled_.[[Value]] is *true*, return *undefined*.
1. Set _alreadyCalled_.[[Value]] to *true*.
1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*.
1. Set _F_.[[AlreadyCalled]] to *true*.
1. Let _index_ be _F_.[[Index]].
1. Let _errors_ be _F_.[[Errors]].
1. Let _promiseCapability_ be _F_.[[Capability]].
Expand Down

0 comments on commit ee71702

Please sign in to comment.