diff --git a/spec.html b/spec.html index 119e370ffcc..c9bc9d04f24 100644 --- a/spec.html +++ b/spec.html @@ -35129,33 +35129,34 @@

%TypedArray%.prototype.slice ( _start_, _end_ )

1. If _relativeEnd_ < 0, let _final_ be max((_len_ + _relativeEnd_), 0); else let _final_ be min(_relativeEnd_, _len_). 1. Let _count_ be max(_final_ - _k_, 0). 1. Let _A_ be ? TypedArraySpeciesCreate(_O_, « _count_ »). - 1. Let _srcName_ be the String value of _O_.[[TypedArrayName]]. - 1. Let _srcType_ be the Element Type value in for _srcName_. - 1. Let _targetName_ be the String value of _A_.[[TypedArrayName]]. - 1. Let _targetType_ be the Element Type value in for _targetName_. - 1. If _srcType_ is different from _targetType_, then - 1. Let _n_ be 0. - 1. Repeat, while _k_ < _final_, - 1. Let _Pk_ be ! ToString(_k_). - 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Perform ! Set(_A_, ! ToString(_n_), _kValue_, *true*). - 1. Set _k_ to _k_ + 1. - 1. Set _n_ to _n_ + 1. - 1. Else if _count_ > 0, then - 1. Let _srcBuffer_ be _O_.[[ViewedArrayBuffer]]. - 1. If IsDetachedBuffer(_srcBuffer_) is *true*, throw a *TypeError* exception. - 1. Let _targetBuffer_ be _A_.[[ViewedArrayBuffer]]. - 1. Let _elementSize_ be the Element Size value specified in for Element Type _srcType_. - 1. NOTE: If _srcType_ and _targetType_ are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data. - 1. Let _srcByteOffset_ be _O_.[[ByteOffset]]. - 1. Let _targetByteIndex_ be _A_.[[ByteOffset]]. - 1. Let _srcByteIndex_ be (_k_ × _elementSize_) + _srcByteOffset_. - 1. Let _limit_ be _targetByteIndex_ + _count_ × _elementSize_. - 1. Repeat, while _targetByteIndex_ < _limit_, - 1. Let _value_ be GetValueFromBuffer(_srcBuffer_, _srcByteIndex_, ~Uint8~, *true*, ~Unordered~). - 1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, ~Uint8~, _value_, *true*, ~Unordered~). - 1. Set _srcByteIndex_ to _srcByteIndex_ + 1. - 1. Set _targetByteIndex_ to _targetByteIndex_ + 1. + 1. If _count_ > 0, then + 1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, throw a *TypeError* exception. + 1. Let _srcName_ be the String value of _O_.[[TypedArrayName]]. + 1. Let _srcType_ be the Element Type value in for _srcName_. + 1. Let _targetName_ be the String value of _A_.[[TypedArrayName]]. + 1. Let _targetType_ be the Element Type value in for _targetName_. + 1. If _srcType_ is different from _targetType_, then + 1. Let _n_ be 0. + 1. Repeat, while _k_ < _final_, + 1. Let _Pk_ be ! ToString(_k_). + 1. Let _kValue_ be ! Get(_O_, _Pk_). + 1. Perform ! Set(_A_, ! ToString(_n_), _kValue_, *true*). + 1. Set _k_ to _k_ + 1. + 1. Set _n_ to _n_ + 1. + 1. Else, + 1. Let _srcBuffer_ be _O_.[[ViewedArrayBuffer]]. + 1. Let _targetBuffer_ be _A_.[[ViewedArrayBuffer]]. + 1. Let _elementSize_ be the Element Size value specified in for Element Type _srcType_. + 1. NOTE: If _srcType_ and _targetType_ are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data. + 1. Let _srcByteOffset_ be _O_.[[ByteOffset]]. + 1. Let _targetByteIndex_ be _A_.[[ByteOffset]]. + 1. Let _srcByteIndex_ be (_k_ × _elementSize_) + _srcByteOffset_. + 1. Let _limit_ be _targetByteIndex_ + _count_ × _elementSize_. + 1. Repeat, while _targetByteIndex_ < _limit_, + 1. Let _value_ be GetValueFromBuffer(_srcBuffer_, _srcByteIndex_, ~Uint8~, *true*, ~Unordered~). + 1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, ~Uint8~, _value_, *true*, ~Unordered~). + 1. Set _srcByteIndex_ to _srcByteIndex_ + 1. + 1. Set _targetByteIndex_ to _targetByteIndex_ + 1. 1. Return _A_.

This function is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.