Skip to content

Commit

Permalink
Have ValidateIntegerTypedArray use ValidateTypedArray; move [[ArrayLe…
Browse files Browse the repository at this point in the history
…ngth]] use before possible detach point
  • Loading branch information
syg committed Jun 24, 2020
1 parent 598dae6 commit de34cd8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -37691,15 +37691,13 @@ <h1>ValidateIntegerTypedArray ( _typedArray_ [ , _waitable_ ] )</h1>
<p>The abstract operation ValidateIntegerTypedArray takes argument _typedArray_ and optional argument _waitable_ (a Boolean). It performs the following steps when called:</p>
<emu-alg>
1. If _waitable_ is not present, set _waitable_ to *false*.
1. Perform ? RequireInternalSlot(_typedArray_, [[TypedArrayName]]).
1. Let _buffer_ be ? ValidateTypedArray(_typedArray_).
1. Let _typeName_ be _typedArray_.[[TypedArrayName]].
1. Let _type_ be the Element Type value in <emu-xref href="#table-the-typedarray-constructors"></emu-xref> for _typeName_.
1. If _waitable_ is *true*, then
1. If _typeName_ is not *"Int32Array"* or *"BigInt64Array"*, throw a *TypeError* exception.
1. Else,
1. If ! IsUnclampedIntegerElementType(_type_) is *false* and ! IsBigIntElementType(_type_) is *false*, throw a *TypeError* exception.
1. Assert: _typedArray_ has a [[ViewedArrayBuffer]] internal slot.
1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]].
1. Return _buffer_.
</emu-alg>
</emu-clause>
Expand All @@ -37709,9 +37707,8 @@ <h1>ValidateAtomicAccess ( _typedArray_, _requestIndex_ )</h1>
<p>The abstract operation ValidateAtomicAccess takes arguments _typedArray_ and _requestIndex_. It performs the following steps when called:</p>
<emu-alg>
1. Assert: _typedArray_ is an Object that has a [[ViewedArrayBuffer]] internal slot.
1. Let _accessIndex_ be ? ToIndex(_requestIndex_).
1. If IsDetachedBuffer(_typedArray_.[[ViewedArrayBuffer]]) is *true*, throw a *TypeError* exception.
1. Let _length_ be _typedArray_.[[ArrayLength]].
1. Let _accessIndex_ be ? ToIndex(_requestIndex_).
1. Assert: _accessIndex_ &ge; 0.
1. If _accessIndex_ &ge; _length_, throw a *RangeError* exception.
1. Return _accessIndex_.
Expand Down

0 comments on commit de34cd8

Please sign in to comment.