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: remove Symbol.species from InitializeTypedArrayFromTypedArray #2719

Merged
merged 1 commit into from
Apr 13, 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
17 changes: 5 additions & 12 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -39079,8 +39079,7 @@ <h1>
1. Else, let _same_ be SameValue(_srcBuffer_, _targetBuffer_).
1. If _same_ is *true*, then
1. Let _srcByteLength_ be _source_.[[ByteLength]].
1. Set _srcBuffer_ to ? <emu-meta suppress-effects="user-code">CloneArrayBuffer(_srcBuffer_, _srcByteOffset_, _srcByteLength_, %ArrayBuffer%)</emu-meta>.
1. NOTE: %ArrayBuffer% is used to clone _srcBuffer_ because is it known to not have any observable side-effects.
1. Set _srcBuffer_ to ? CloneArrayBuffer(_srcBuffer_, _srcByteOffset_, _srcByteLength_).
syg marked this conversation as resolved.
Show resolved Hide resolved
1. Let _srcByteIndex_ be 0.
1. Else, let _srcByteIndex_ be _srcByteOffset_.
1. Let _targetByteIndex_ be _targetOffset_ &times; _targetElementSize_ + _targetByteOffset_.
Expand Down Expand Up @@ -39494,15 +39493,10 @@ <h1>
1. Let _srcByteOffset_ be _srcArray_.[[ByteOffset]].
1. Let _elementLength_ be _srcArray_.[[ArrayLength]].
1. Let _byteLength_ be _elementSize_ &times; _elementLength_.
1. If IsSharedArrayBuffer(_srcData_) is *false*, then
1. Let _bufferConstructor_ be ? SpeciesConstructor(_srcData_, %ArrayBuffer%).
1. Else,
1. Let _bufferConstructor_ be %ArrayBuffer%.
1. If _elementType_ is the same as _srcType_, then
1. Let _data_ be ? CloneArrayBuffer(_srcData_, _srcByteOffset_, _byteLength_, _bufferConstructor_).
1. Let _data_ be ? CloneArrayBuffer(_srcData_, _srcByteOffset_, _byteLength_).
1. Else,
1. Let _data_ be ? AllocateArrayBuffer(_bufferConstructor_, _byteLength_).
1. If IsDetachedBuffer(_srcData_) is *true*, throw a *TypeError* exception.
1. Let _data_ be ? <emu-meta suppress-effects="user-code">AllocateArrayBuffer(%ArrayBuffer%, _byteLength_)</emu-meta>.
1. If _srcArray_.[[ContentType]] &ne; _O_.[[ContentType]], throw a *TypeError* exception.
1. Let _srcByteIndex_ be _srcByteOffset_.
1. Let _targetByteIndex_ be 0.
Expand Down Expand Up @@ -40670,16 +40664,15 @@ <h1>
_srcBuffer_: an ArrayBuffer or a SharedArrayBuffer,
_srcByteOffset_: a non-negative integer,
_srcLength_: a non-negative integer,
_cloneConstructor_: a constructor,
): either a normal completion containing an ArrayBuffer or an abrupt completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>It creates a new ArrayBuffer whose data is a copy of _srcBuffer_'s data over the range starting at _srcByteOffset_ and continuing for _srcLength_ bytes.</dd>
</dl>
<emu-alg>
1. Let _targetBuffer_ be ? AllocateArrayBuffer(_cloneConstructor_, _srcLength_).
1. If IsDetachedBuffer(_srcBuffer_) is *true*, throw a *TypeError* exception.
1. Assert: IsDetachedBuffer(_srcBuffer_) is *false*.
1. Let _targetBuffer_ be ? <emu-meta suppress-effects="user-code">AllocateArrayBuffer(%ArrayBuffer%, _srcLength_)</emu-meta>.
1. Let _srcBlock_ be _srcBuffer_.[[ArrayBufferData]].
1. Let _targetBlock_ be _targetBuffer_.[[ArrayBufferData]].
1. Perform CopyDataBlockBytes(_targetBlock_, 0, _srcBlock_, _srcByteOffset_, _srcLength_).
Expand Down