Skip to content

Commit

Permalink
Editorial: Rename TypedArrayCreate to `TypedArrayCreateFromConstruc…
Browse files Browse the repository at this point in the history
…tor` (tc39#3194)

... to prevent a future name collision.
  • Loading branch information
jmdyck authored and ljharb committed Nov 3, 2023
1 parent 82c99bb commit d6bdb8a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -40316,7 +40316,7 @@ <h1>%TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )</h1>
1. If _usingIterator_ is not *undefined*, then
1. Let _values_ be ? IteratorToList(? GetIteratorFromMethod(_source_, _usingIterator_)).
1. Let _len_ be the number of elements in _values_.
1. Let _targetObj_ be ? TypedArrayCreate(_C_, « 𝔽(_len_) »).
1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »).
1. Let _k_ be 0.
1. Repeat, while _k_ &lt; _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
Expand All @@ -40333,7 +40333,7 @@ <h1>%TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )</h1>
1. NOTE: _source_ is not an Iterable so assume it is already an array-like object.
1. Let _arrayLike_ be ! ToObject(_source_).
1. Let _len_ be ? LengthOfArrayLike(_arrayLike_).
1. Let _targetObj_ be ? TypedArrayCreate(_C_, « 𝔽(_len_) »).
1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »).
1. Let _k_ be 0.
1. Repeat, while _k_ &lt; _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
Expand All @@ -40355,7 +40355,7 @@ <h1>%TypedArray%.of ( ..._items_ )</h1>
1. Let _len_ be the number of elements in _items_.
1. Let _C_ be the *this* value.
1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception.
1. Let _newObj_ be ? TypedArrayCreate(_C_, « 𝔽(_len_) »).
1. Let _newObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »).
1. Let _k_ be 0.
1. Repeat, while _k_ &lt; _len_,
1. Let _kValue_ be _items_[_k_].
Expand Down Expand Up @@ -41272,16 +41272,16 @@ <h1>
<emu-alg>
1. Let _defaultConstructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in <emu-xref href="#table-the-typedarray-constructors"></emu-xref>.
1. Let _constructor_ be ? SpeciesConstructor(_exemplar_, _defaultConstructor_).
1. Let _result_ be ? TypedArrayCreate(_constructor_, _argumentList_).
1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_).
1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots.
1. If _result_.[[ContentType]] is not _exemplar_.[[ContentType]], throw a *TypeError* exception.
1. Return _result_.
</emu-alg>
</emu-clause>

<emu-clause id="typedarray-create" type="abstract operation">
<emu-clause id="sec-typedarraycreatefromconstructor" oldids="typedarray-create" type="abstract operation">
<h1>
TypedArrayCreate (
TypedArrayCreateFromConstructor (
_constructor_: a constructor,
_argumentList_: a List of ECMAScript language values,
): either a normal completion containing a TypedArray or a throw completion
Expand Down Expand Up @@ -41314,7 +41314,7 @@ <h1>
</dl>
<emu-alg>
1. Let _constructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in <emu-xref href="#table-the-typedarray-constructors"></emu-xref>.
1. Let _result_ be ? TypedArrayCreate(_constructor_, _argumentList_).
1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_).
1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots.
1. Assert: _result_.[[ContentType]] is _exemplar_.[[ContentType]].
1. Return _result_.
Expand Down

0 comments on commit d6bdb8a

Please sign in to comment.