You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_remainingElementsCount_: a Record { [[Value]]: a non-negative integer },
2202
+
): a function object</ins>
2203
+
</h1>
2204
+
<dl class="header">
2205
+
<dt>description</dt>
2206
+
<dd>It creates a resolve element function for use with PerformPromiseAll and SafePerformPromiseAll.</dd>
2207
+
</dl>
2208
+
<emu-alg>
2209
+
1. Let _fulfilledSteps_ be a new Abstract Closure with parameters (_value_) that captures _values_, _resultCapability_, and _remainingElementsCount_ and performs the following steps when called:
2210
+
1. Let _F_ be the active function object.
2211
+
1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*.
2212
+
1. Set _F_.[[AlreadyCalled]] to *true*.
2213
+
1. Let _thisIndex_ be _F_.[[Index]].
2214
+
1. Set _values_[_thisIndex_] to _value_.
2215
+
1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
2216
+
1. If _remainingElementsCount_.[[Value]] = 0, then
2217
+
1. Let _valuesArray_ be CreateArrayFromList(_values_).
): either a normal completion containing an ECMAScript language value or a throw completion
2235
+
</h1>
2236
+
<dl class="header">
2237
+
</dl>
2238
+
<emu-alg>
2239
+
1. Let _values_ be a new empty List.
2240
+
1. [declared="remainingElementsCount"] NOTE: _remainingElementsCount_ starts at 1 instead of 0 to ensure _resultCapability_.[[Resolve]] is only called once, even in the presence of a misbehaving *"then"* which calls the passed callback before the input iterator is exhausted.
2241
+
1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }.
2242
+
1. Let _index_ be 0.
2243
+
1. Repeat,
2244
+
1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
2245
+
1. If _next_ is ~done~, then
2246
+
1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
2247
+
1. If _remainingElementsCount_.[[Value]] = 0, then
2248
+
1. Let _valuesArray_ be CreateArrayFromList(_values_).
1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »).
2253
+
1. <del>Let _fulfilledSteps_ be a new Abstract Closure with parameters (_value_) that captures _values_, _resultCapability_, and _remainingElementsCount_ and performs the following steps when called:</del>
2254
+
1. <del>Let _F_ be the active function object.</del>
2255
+
1. <del>If _F_.[[AlreadyCalled]] is *true*, return *undefined*.</del>
2256
+
1. <del>Set _F_.[[AlreadyCalled]] to *true*.</del>
2257
+
1. <del>Let _thisIndex_ be _F_.[[Index]].</del>
2258
+
1. <del>Set _values_[_thisIndex_] to _value_.</del>
2259
+
1. <del>Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.</del>
<dd>It performs a Promise.all operation on a list of native promises, calling PerformPromiseThen directly instead of looking up *"then"* on each promise.</dd>
2283
+
</dl>
2284
+
<emu-alg>
2285
+
1. Let _resultCapability_ be ! NewPromiseCapability(%Promise%).
0 commit comments