Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Use IntegerIndexedElementSet in %TypedArray%.prototype.set #2646

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -39118,25 +39118,17 @@ <h1>
1. Let _targetBuffer_ be _target_.[[ViewedArrayBuffer]].
1. If IsDetachedBuffer(_targetBuffer_) is *true*, throw a *TypeError* exception.
1. Let _targetLength_ be _target_.[[ArrayLength]].
1. Let _targetElementSize_ be TypedArrayElementSize(_target_).
1. Let _targetType_ be TypedArrayElementType(_target_).
1. Let _targetByteOffset_ be _target_.[[ByteOffset]].
1. Let _src_ be ? ToObject(_source_).
1. Let _srcLength_ be ? LengthOfArrayLike(_src_).
1. If _targetOffset_ is +&infin;, throw a *RangeError* exception.
1. If _srcLength_ + _targetOffset_ &gt; _targetLength_, throw a *RangeError* exception.
1. Let _targetByteIndex_ be _targetOffset_ &times; _targetElementSize_ + _targetByteOffset_.
1. Let _k_ be 0.
1. Let _limit_ be _targetByteIndex_ + _targetElementSize_ &times; _srcLength_.
1. Repeat, while _targetByteIndex_ &lt; _limit_,
1. Repeat, while _k_ &lt; _srcLength_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
1. Let _value_ be ? Get(_src_, _Pk_).
1. If _target_.[[ContentType]] is ~BigInt~, set _value_ to ? ToBigInt(_value_).
1. Otherwise, set _value_ to ? ToNumber(_value_).
1. If IsDetachedBuffer(_targetBuffer_) is *true*, throw a *TypeError* exception.
1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, _targetType_, _value_, *true*, ~Unordered~).
1. Let _targetIndex_ be 𝔽(_targetOffset_ + _k_).
1. Perform ? IntegerIndexedElementSet(_target_, _targetIndex_, _value_).
1. Set _k_ to _k_ + 1.
1. Set _targetByteIndex_ to _targetByteIndex_ + _targetElementSize_.
1. Return ~unused~.
</emu-alg>
</emu-clause>
Expand Down