WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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
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.
49280
49281
1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }.
49281
49282
1. Let _index_ be 0.
49282
49283
1. Repeat,
@@ -49289,40 +49290,24 @@ <h1>
49289
49290
1. Return _resultCapability_.[[Promise]].
49290
49291
1. Append *undefined* to _values_.
49291
49292
1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »).
49292
-
1. Let _steps_ be the algorithm steps defined in <emu-xref href="#sec-promise.all-resolve-element-functions" title></emu-xref>.
49293
-
1. Let _length_ be the number of non-optional parameters of the function definition in <emu-xref href="#sec-promise.all-resolve-element-functions" title></emu-xref>.
49294
-
1. Let _onFulfilled_ be CreateBuiltinFunction(_steps_, _length_, *""*, « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
49293
+
1. Let _fulfilledSteps_ be a new Abstract Closure with parameters (_value_) that captures _values_, _resultCapability_, and _remainingElementsCount_ and performs the following steps when called:
49294
+
1. Let _F_ be the active function object.
49295
+
1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*.
49296
+
1. Set _F_.[[AlreadyCalled]] to *true*.
49297
+
1. Let _index_ be _F_.[[Index]].
49298
+
1. Set _values_[_index_] to _value_.
49299
+
1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
49300
+
1. If _remainingElementsCount_.[[Value]] = 0, then
49301
+
1. Let _valuesArray_ be CreateArrayFromList(_values_).
<p>A `Promise.all` resolve element function is an anonymous built-in function that is used to resolve a specific `Promise.all` element. Each `Promise.all` resolve element function has [[Index]], [[Values]], [[Capability]], [[RemainingElements]], and [[AlreadyCalled]] internal slots.</p>
49309
-
<p>When a `Promise.all` resolve element function is called with argument _x_, the following steps are taken:</p>
49310
-
<emu-alg>
49311
-
1. Let _F_ be the active function object.
49312
-
1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*.
49313
-
1. Set _F_.[[AlreadyCalled]] to *true*.
49314
-
1. Let _index_ be _F_.[[Index]].
49315
-
1. Let _values_ be _F_.[[Values]].
49316
-
1. Let _promiseCapability_ be _F_.[[Capability]].
49317
-
1. Let _remainingElementsCount_ be _F_.[[RemainingElements]].
49318
-
1. Set _values_[_index_] to _x_.
49319
-
1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
49320
-
1. If _remainingElementsCount_.[[Value]] = 0, then
49321
-
1. Let _valuesArray_ be CreateArrayFromList(_values_).
0 commit comments