From a545cb8623e9f107c40641402109fb9265c0ba38 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Mon, 24 Oct 2022 14:27:38 -0600 Subject: [PATCH 01/10] Editorial: support built-in async functions --- spec.html | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index fcb83ac1d6..de662a1ef0 100644 --- a/spec.html +++ b/spec.html @@ -13991,8 +13991,8 @@

Built-in Function Objects

  • [[InitialName]], a String that is the initial name of the function. It is used by .
  • The initial value of a built-in function object's [[Prototype]] internal slot is %Function.prototype%, unless otherwise specified.

    -

    A built-in function object must have a [[Call]] internal method that conforms to the definition in .

    -

    A built-in function object has a [[Construct]] internal method if and only if it is described as a “constructor”, or some algorithm in this specification explicitly sets its [[Construct]] internal method. Such a [[Construct]] internal method must conform to the definition in .

    +

    A built-in function object must have a [[Call]] internal method that, unless otherwise specified, conforms to the definition in .

    +

    A built-in function object has a [[Construct]] internal method if and only if it is described as a “constructor”, or some algorithm in this specification explicitly sets its [[Construct]] internal method. Unless otherwise specified, such a [[Construct]] internal method must conform to the definition in .

    An implementation may provide additional built-in function objects that are not defined in this specification.

    @@ -14081,7 +14081,10 @@

    1. If _prototype_ is not present, set _prototype_ to _realm_.[[Intrinsics]].[[%Function.prototype%]]. 1. Let _internalSlotsList_ be a List containing the names of all the internal slots that requires for the built-in function object that is about to be created. 1. Append to _internalSlotsList_ the elements of _additionalInternalSlotsList_. - 1. Let _func_ be a new built-in function object that, when called, performs the action described by _behaviour_ using the provided arguments as the values of the corresponding parameters specified by _behaviour_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot. + 1. If _behaviour_ is described as async, then + 1. Let _func_ be a new built-in async function object that, when called, performs the action described by _behaviour_ using the provided arguments as the values of the corresponding parameters specified by _behaviour_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot. + 1. Else, + 1. Let _func_ be a new built-in function object that, when called, performs the action described by _behaviour_ using the provided arguments as the values of the corresponding parameters specified by _behaviour_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot. 1. Set _func_.[[Prototype]] to _prototype_. 1. Set _func_.[[Extensible]] to *true*. 1. Set _func_.[[Realm]] to _realm_. @@ -14097,6 +14100,57 @@

    + +

    Built-in Async Function Objects

    +

    Built-in async function objects are built-in function objects that provide [[Call]] and [[Construct]] internal methods that conform to the following definitions:

    + + +

    + [[Call]] ( + _thisArgument_: an ECMAScript language value, + _argumentsList_: a List of ECMAScript language values, + ): a normal completion containing a Promise +

    +
    +
    for
    +
    a built-in async function object _F_
    +
    + + 1. Let _callerContext_ be the running execution context. + 1. If _callerContext_ is not already suspended, suspend _callerContext_. + 1. Let _calleeContext_ be a new execution context. + 1. Set the Function of _calleeContext_ to _F_. + 1. Let _calleeRealm_ be _F_.[[Realm]]. + 1. Set the Realm of _calleeContext_ to _calleeRealm_. + 1. Set the ScriptOrModule of _calleeContext_ to *null*. + 1. Perform any necessary implementation-defined initialization of _calleeContext_. + 1. Push _calleeContext_ onto the execution context stack; _calleeContext_ is now the running execution context. + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _resultsClosure_ be a new Abstract Closure with no parameters that captures _F_, _thisArgument_, and _argumentsList_ and performs the following steps when called: + 1. Return the Completion Record that is the result of evaluating _F_ in a manner that conforms to the specification of _F_. _thisArgument_ is the *this* value, _argumentsList_ provides the named parameters, and the NewTarget value is *undefined*. + 1. Perform AsyncFunctionStart(_promiseCapability_, _resultsClosure_). + 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. + 1. Return _promiseCapability_.[[Promise]]. + +
    + + +

    + [[Construct]] ( + _argumentsList_: a List of ECMAScript language values, + _newTarget_: a constructor, + ): either a normal completion containing an Object or a throw completion +

    +
    +
    for
    +
    a built-in async function object _F_
    +
    + + 1. Throw a *TypeError* exception. + +
    +
    +

    Built-in Exotic Object Internal Methods and Slots

    This specification defines several kinds of built-in exotic objects. These objects generally behave similar to ordinary objects except for a few specific situations. The following exotic objects use the ordinary object internal methods except where it is explicitly specified otherwise below:

    From b4c45bedbfca607152a217c148c025d33e8aad45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Thu, 1 May 2025 07:34:36 -0600 Subject: [PATCH 02/10] Normative: Add Array.fromAsync From [proposal-array-from-async](https://github.com/tc39/proposal-array-from-async). --- spec.html | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/spec.html b/spec.html index de662a1ef0..92612cd2e3 100644 --- a/spec.html +++ b/spec.html @@ -7393,6 +7393,20 @@

    + +

    IfAbruptCloseAsyncIterator ( _value_, _iteratorRecord_ )

    +

    IfAbruptCloseAsyncIterator is a shorthand for a sequence of algorithm steps that use an Iterator Record. An algorithm step of the form:

    + + 1. IfAbruptCloseAsyncIterator(_value_, _iteratorRecord_). + +

    means the same thing as:

    + + 1. Assert: _value_ is a Completion Record. + 1. If _value_ is an abrupt completion, return ? AsyncIteratorClose(_iteratorRecord_, _value_). + 1. Else, set _value_ to ! _value_. + +
    +

    CreateIteratorResultObject ( @@ -39843,6 +39857,82 @@

    Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    + +

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    + +

    This async method performs the following steps when called:

    + + 1. Let _C_ be the *this* value. + 1. If _mapper_ is *undefined*, then + 1. Let _mapping_ be *false*. + 1. Else, + 1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. + 1. Let _mapping_ be *true*. + 1. Let _usingAsyncIterator_ be ? GetMethod(_asyncItems_, %Symbol.asyncIterator%). + 1. If _usingAsyncIterator_ is *undefined*, then + 1. Let _usingSyncIterator_ be ? GetMethod(_asyncItems_, %Symbol.iterator%). + 1. Let _iteratorRecord_ be *undefined*. + 1. If _usingAsyncIterator_ is not *undefined*, then + 1. Set _iteratorRecord_ to ? GetIteratorFromMethod(_asyncItems_, _usingAsyncIterator_). + 1. Else if _usingSyncIterator_ is not *undefined*, then + 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_asyncItems_, _usingSyncIterator_)). + 1. If _iteratorRecord_ is not *undefined*, then + 1. If IsConstructor(_C_) is *true*, then + 1. Let _A_ be ? Construct(_C_). + 1. Else, + 1. Let _A_ be ! ArrayCreate(0). + 1. Let _k_ be 0. + 1. Repeat, + 1. If _k_ ≥ 253 - 1, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? AsyncIteratorClose(_iteratorRecord_, _error_). + 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _nextResult_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]]). + 1. Set _nextResult_ to ? Await(_nextResult_). + 1. If _nextResult_ is not an Object, throw a *TypeError* exception. + 1. Let _done_ be ? IteratorComplete(_nextResult_). + 1. If _done_ is *true*, then + 1. Perform ? Set(_A_, *"length"*, 𝔽(_k_), *true*). + 1. Return _A_. + 1. Let _nextValue_ be ? IteratorValue(_nextResult_). + 1. If _mapping_ is *true*, then + 1. Let _mappedValue_ be Completion(Call(_mapper_, _thisArg_, « _nextValue_, 𝔽(_k_) »)). + 1. IfAbruptCloseAsyncIterator(_mappedValue_, _iteratorRecord_). + 1. Set _mappedValue_ to Completion(Await(_mappedValue_)). + 1. IfAbruptCloseAsyncIterator(_mappedValue_, _iteratorRecord_). + 1. Else, + 1. Let _mappedValue_ be _nextValue_. + 1. Let _defineStatus_ be Completion(CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_)). + 1. IfAbruptCloseAsyncIterator(_defineStatus_, _iteratorRecord_). + 1. Set _k_ to _k_ + 1. + 1. Else, + 1. NOTE: _asyncItems_ is neither an AsyncIterable nor an Iterable so assume it is an array-like object. + 1. Let _arrayLike_ be ! ToObject(_asyncItems_). + 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). + 1. If IsConstructor(_C_) is *true*, then + 1. Let _A_ be ? Construct(_C_, « 𝔽(_len_) »). + 1. Else, + 1. Let _A_ be ? ArrayCreate(_len_). + 1. Let _k_ be 0. + 1. Repeat, while _k_ < _len_, + 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). + 1. Set _kValue_ to ? Await(_kValue_). + 1. If _mapping_ is *true*, then + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Set _mappedValue_ to ? Await(_mappedValue_). + 1. Else, + 1. Let _mappedValue_ be _kValue_. + 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). + 1. Set _k_ to _k_ + 1. + 1. Perform ? Set(_A_, *"length"*, 𝔽(_len_), *true*). + 1. Return _A_. + + +

    This method is an intentionally generic factory method; it does not require that its *this* value be the Array constructor. Therefore it can be transferred to or inherited by any other constructors that may be called with a single numeric argument.

    +
    +
    +

    Array.isArray ( _arg_ )

    This function performs the following steps when called:

    From 1b2d5bb9e0fb5d19cbcdd3b9206f72981514bbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Wed, 21 May 2025 17:08:48 -0600 Subject: [PATCH 03/10] Editorial: Make Array.fromAsync's esid lowercase Co-authored-by: Linus Groh --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 92612cd2e3..90b1636607 100644 --- a/spec.html +++ b/spec.html @@ -39857,7 +39857,7 @@

    Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    - +

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    This async method performs the following steps when called:

    From 09d4b3b675d933585ddf86001022fc79aca32ba9 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 21 May 2025 20:15:54 -0600 Subject: [PATCH 04/10] accept review feedback --- spec.html | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/spec.html b/spec.html index de662a1ef0..922114faad 100644 --- a/spec.html +++ b/spec.html @@ -14102,7 +14102,7 @@

    Built-in Async Function Objects

    -

    Built-in async function objects are built-in function objects that provide [[Call]] and [[Construct]] internal methods that conform to the following definitions:

    +

    Built-in async function objects are built-in function objects that provide a [[Call]] internal method that conforms to the following definition:

    @@ -14127,28 +14127,12 @@

    1. Push _calleeContext_ onto the execution context stack; _calleeContext_ is now the running execution context. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _resultsClosure_ be a new Abstract Closure with no parameters that captures _F_, _thisArgument_, and _argumentsList_ and performs the following steps when called: - 1. Return the Completion Record that is the result of evaluating _F_ in a manner that conforms to the specification of _F_. _thisArgument_ is the *this* value, _argumentsList_ provides the named parameters, and the NewTarget value is *undefined*. + 1. Return the Completion Record that is the result of evaluating _F_ in a manner that conforms to the specification of _F_. _thisArgument_ provides the *this* value, _argumentsList_ provides the named parameters, and the NewTarget value is *undefined*. 1. Perform AsyncFunctionStart(_promiseCapability_, _resultsClosure_). 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. 1. Return _promiseCapability_.[[Promise]]. - - -

    - [[Construct]] ( - _argumentsList_: a List of ECMAScript language values, - _newTarget_: a constructor, - ): either a normal completion containing an Object or a throw completion -

    -
    -
    for
    -
    a built-in async function object _F_
    -
    - - 1. Throw a *TypeError* exception. - -
    From 09fe8d132748c0e87b204de727b522c1c91b2239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Wed, 21 May 2025 21:17:52 -0600 Subject: [PATCH 05/10] Editorial: Change Array.from/fromAsync from "method"s to "function"s Co-authored-by: Linus Groh --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 90b1636607..dde5477711 100644 --- a/spec.html +++ b/spec.html @@ -39799,7 +39799,7 @@

    Properties of the Array Constructor

    Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    -

    This method performs the following steps when called:

    +

    This function performs the following steps when called:

    1. Let _C_ be the *this* value. 1. If _mapper_ is *undefined*, then @@ -39860,7 +39860,7 @@

    Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    -

    This async method performs the following steps when called:

    +

    This function performs the following steps when called:

    1. Let _C_ be the *this* value. 1. If _mapper_ is *undefined*, then From b4438b920515b62bc149539dff06ec1d98f45f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Wed, 28 May 2025 08:15:00 -0600 Subject: [PATCH 06/10] Editorial: Change Array.fromAsync asyncItems note Co-authored-by: Michael Ficarra --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index dde5477711..2061b0661d 100644 --- a/spec.html +++ b/spec.html @@ -39906,7 +39906,7 @@

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    1. IfAbruptCloseAsyncIterator(_defineStatus_, _iteratorRecord_). 1. Set _k_ to _k_ + 1. 1. Else, - 1. NOTE: _asyncItems_ is neither an AsyncIterable nor an Iterable so assume it is an array-like object. + 1. NOTE: _asyncItems_ is neither async iterable nor iterable so assume it is an array-like object. 1. Let _arrayLike_ be ! ToObject(_asyncItems_). 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). 1. If IsConstructor(_C_) is *true*, then From a55e8823be6b5435c4c113e44c1cb05de8870b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Wed, 28 May 2025 09:02:46 -0600 Subject: [PATCH 07/10] Editorial: Simplify branching Co-Authored-By: Michael Ficarra --- spec.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec.html b/spec.html index 2061b0661d..c009d097af 100644 --- a/spec.html +++ b/spec.html @@ -39863,19 +39863,19 @@

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    This function performs the following steps when called:

    1. Let _C_ be the *this* value. - 1. If _mapper_ is *undefined*, then - 1. Let _mapping_ be *false*. - 1. Else, + 1. Let _mapping_ be *false*. + 1. If _mapper_ is not *undefined*, then 1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. - 1. Let _mapping_ be *true*. + 1. Set _mapping_ to *true*. + 1. Let _iteratorRecord_ be *undefined*. 1. Let _usingAsyncIterator_ be ? GetMethod(_asyncItems_, %Symbol.asyncIterator%). 1. If _usingAsyncIterator_ is *undefined*, then 1. Let _usingSyncIterator_ be ? GetMethod(_asyncItems_, %Symbol.iterator%). - 1. Let _iteratorRecord_ be *undefined*. - 1. If _usingAsyncIterator_ is not *undefined*, then + 1. If _usingSyncIterator_ is not *undefined*, then + 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_asyncItems_, _usingSyncIterator_)). + 1. Else, 1. Set _iteratorRecord_ to ? GetIteratorFromMethod(_asyncItems_, _usingAsyncIterator_). - 1. Else if _usingSyncIterator_ is not *undefined*, then - 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_asyncItems_, _usingSyncIterator_)). +_usingSyncIterator_)). 1. If _iteratorRecord_ is not *undefined*, then 1. If IsConstructor(_C_) is *true*, then 1. Let _A_ be ? Construct(_C_). From fc28be7147d8236c1dfcc79e95f01c620a187e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Wed, 28 May 2025 09:04:52 -0600 Subject: [PATCH 08/10] Editorial: Explicitly mark Array.fromAsync as async; rename asyncItems arg to items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The behavior of Array.fromAsync must be marked as “async” in order to activate the special “built-in async function” mechanisms in #2942. --- spec.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec.html b/spec.html index c009d097af..225325383d 100644 --- a/spec.html +++ b/spec.html @@ -39858,9 +39858,9 @@

    Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    -

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    +

    Array.fromAsync ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    -

    This function performs the following steps when called:

    +

    This async function performs the following steps when called:

    1. Let _C_ be the *this* value. 1. Let _mapping_ be *false*. @@ -39868,13 +39868,13 @@

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. 1. Set _mapping_ to *true*. 1. Let _iteratorRecord_ be *undefined*. - 1. Let _usingAsyncIterator_ be ? GetMethod(_asyncItems_, %Symbol.asyncIterator%). + 1. Let _usingAsyncIterator_ be ? GetMethod(_items_, %Symbol.asyncIterator%). 1. If _usingAsyncIterator_ is *undefined*, then - 1. Let _usingSyncIterator_ be ? GetMethod(_asyncItems_, %Symbol.iterator%). + 1. Let _usingSyncIterator_ be ? GetMethod(_items_, %Symbol.iterator%). 1. If _usingSyncIterator_ is not *undefined*, then - 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_asyncItems_, _usingSyncIterator_)). + 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_items_, _usingSyncIterator_)). 1. Else, - 1. Set _iteratorRecord_ to ? GetIteratorFromMethod(_asyncItems_, _usingAsyncIterator_). + 1. Set _iteratorRecord_ to ? GetIteratorFromMethod(_items_, _usingAsyncIterator_). _usingSyncIterator_)). 1. If _iteratorRecord_ is not *undefined*, then 1. If IsConstructor(_C_) is *true*, then @@ -39906,8 +39906,8 @@

    Array.fromAsync ( _asyncItems_ [ , _mapper_ [ , _thisArg_ ] ] )

    1. IfAbruptCloseAsyncIterator(_defineStatus_, _iteratorRecord_). 1. Set _k_ to _k_ + 1. 1. Else, - 1. NOTE: _asyncItems_ is neither async iterable nor iterable so assume it is an array-like object. - 1. Let _arrayLike_ be ! ToObject(_asyncItems_). + 1. NOTE: _items_ is neither async iterable nor iterable so assume it is an array-like object. + 1. Let _arrayLike_ be ! ToObject(_items_). 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). 1. If IsConstructor(_C_) is *true*, then 1. Let _A_ be ? Construct(_C_, « 𝔽(_len_) »). From 680ba5445046da4ceac82c1bec697d82ab7f64cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Wed, 28 May 2025 15:25:22 -0600 Subject: [PATCH 09/10] Editorial: Fix typo in Array.fromAsync behavior --- spec.html | 1 - 1 file changed, 1 deletion(-) diff --git a/spec.html b/spec.html index 225325383d..4614565ca2 100644 --- a/spec.html +++ b/spec.html @@ -39875,7 +39875,6 @@

    Array.fromAsync ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_items_, _usingSyncIterator_)). 1. Else, 1. Set _iteratorRecord_ to ? GetIteratorFromMethod(_items_, _usingAsyncIterator_). -_usingSyncIterator_)). 1. If _iteratorRecord_ is not *undefined*, then 1. If IsConstructor(_C_) is *true*, then 1. Let _A_ be ? Construct(_C_). From 8462af1e87b6f4fa3ac67c6b929ab2affd011db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Wed, 28 May 2025 15:38:02 -0600 Subject: [PATCH 10/10] Editorial: Fix indentation formatting in Array.fromAsync behavior --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 4614565ca2..1d88f8dc35 100644 --- a/spec.html +++ b/spec.html @@ -39872,7 +39872,7 @@

    Array.fromAsync ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

    1. If _usingAsyncIterator_ is *undefined*, then 1. Let _usingSyncIterator_ be ? GetMethod(_items_, %Symbol.iterator%). 1. If _usingSyncIterator_ is not *undefined*, then - 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_items_, _usingSyncIterator_)). + 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_items_, _usingSyncIterator_)). 1. Else, 1. Set _iteratorRecord_ to ? GetIteratorFromMethod(_items_, _usingAsyncIterator_). 1. If _iteratorRecord_ is not *undefined*, then