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
_targetOffset_: a non-negative integer or +∞,
296
-
_source_: a TypedArray,
297
-
): either a normal completion containing ~unused~ or a throw completion
298
-
</h1>
299
-
<dl class="header">
300
-
<dt>description</dt>
301
-
<dd>It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.</dd>
302
-
</dl>
303
-
<emu-alg>
304
-
1. Let _targetBuffer_ be _target_.[[ViewedArrayBuffer]].
305
-
1. Let _targetRecord_ be MakeTypedArrayWithBufferWitnessRecord(_target_, ~seq-cst~).
306
-
1. If IsTypedArrayOutOfBounds(_targetRecord_) is *true*, throw a *TypeError* exception.
307
-
1. <ins>If IsImmutableBuffer(_target_.[[ViewedArrayBuffer]]) is *true*, throw a *TypeError* exception.</ins>
308
-
1. Let _targetLength_ be TypedArrayLength(_targetRecord_).
309
-
1. Let _srcBuffer_ be _source_.[[ViewedArrayBuffer]].
310
-
1. Let _srcRecord_ be MakeTypedArrayWithBufferWitnessRecord(_source_, ~seq-cst~).
311
-
1. If IsTypedArrayOutOfBounds(_srcRecord_) is *true*, throw a *TypeError* exception.
312
-
1. Let _srcLength_ be TypedArrayLength(_srcRecord_).
313
-
1. Let _targetType_ be TypedArrayElementType(_target_).
314
-
1. Let _targetElementSize_ be TypedArrayElementSize(_target_).
315
-
1. Let _targetByteOffset_ be _target_.[[ByteOffset]].
316
-
1. Let _srcType_ be TypedArrayElementType(_source_).
317
-
1. Let _srcElementSize_ be TypedArrayElementSize(_source_).
318
-
1. Let _srcByteOffset_ be _source_.[[ByteOffset]].
319
-
1. If _targetOffset_ = +∞, throw a *RangeError* exception.
320
-
1. If _srcLength_ + _targetOffset_ > _targetLength_, throw a *RangeError* exception.
321
-
1. If _target_.[[ContentType]] is not _source_.[[ContentType]], throw a *TypeError* exception.
322
-
1. If IsSharedArrayBuffer(_srcBuffer_) is *true*, IsSharedArrayBuffer(_targetBuffer_) is *true*, and _srcBuffer_.[[ArrayBufferData]] is _targetBuffer_.[[ArrayBufferData]], let _sameSharedArrayBuffer_ be *true*; otherwise, let _sameSharedArrayBuffer_ be *false*.
323
-
1. If SameValue(_srcBuffer_, _targetBuffer_) is *true* or _sameSharedArrayBuffer_ is *true*, then
324
-
1. Let _srcByteLength_ be TypedArrayByteLength(_srcRecord_).
325
-
1. Set _srcBuffer_ to ? CloneArrayBuffer(_srcBuffer_, _srcByteOffset_, _srcByteLength_).
326
-
1. Let _srcByteIndex_ be 0.
327
-
1. Else,
328
-
1. Let _srcByteIndex_ be _srcByteOffset_.
329
-
1. Let _targetByteIndex_ be (_targetOffset_ × _targetElementSize_) + _targetByteOffset_.
330
-
1. Let _limit_ be _targetByteIndex_ + (_targetElementSize_ × _srcLength_).
331
-
1. If _srcType_ is _targetType_, then
332
-
1. NOTE: The transfer must be performed in a manner that preserves the bit-level encoding of the source data.
333
-
1. Repeat, while _targetByteIndex_ < _limit_,
334
-
1. Let _value_ be GetValueFromBuffer(_srcBuffer_, _srcByteIndex_, ~uint8~, *true*, ~unordered~).
<p>This method sets multiple values in this _TypedArray_, reading the values from _source_. The details differ based upon the type of _source_. The optional _offset_ value indicates the first element index in this _TypedArray_ where values are written. If omitted, it is assumed to be 0.</p>
291
+
<p>It performs the following steps when called:</p>
292
+
<emu-alg>
293
+
1. Let _target_ be the *this* value.
294
+
1. <ins>NOTE: `Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~<ins>, ~write~</ins>).` here would observably change the observable calls into user code and thrown error when IsTypedArrayOutOfBounds returns *true* and _offset_ is negative. Such a change should be pursued.</ins>
0 commit comments