Skip to content

Commit

Permalink
Factor out IsFixedLengthTypedArray AO
Browse files Browse the repository at this point in the history
  • Loading branch information
syg committed Oct 18, 2024
1 parent c29a7ec commit 153f59a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -14627,12 +14627,8 @@ <h1>[[PreventExtensions]] ( ): a normal completion containing a Boolean</h1>
<dd>a TypedArray _O_</dd>
</dl>
<emu-alg>
1. Let _buffer_ be _O_.[[ViewedArrayBuffer]].
1. Let _taIsFixedLength_ be *true*.
1. If _O_.[[ArrayLength]] is ~auto~, set _taIsFixedLength_ to *false*.
1. If IsFixedLengthArrayBuffer(_buffer_) is *false* and IsSharedArrayBuffer(_buffer_) is *false*, set _taIsFixedLength_ to *false*.
1. NOTE: The extensibility-related invariants specified in <emu-xref href="#sec-invariants-of-the-essential-internal-methods"></emu-xref> do not allow this method to return *true* when _O_ can gain (or lose and then regain) integer index properties, which might occur with resizing of its underlying buffer.
1. If _taIsFixedLength_ is *false*, return *false*.
1. If IsFixedLengthTypedArray(_O_) is *false*, return *false*.
1. Return OrdinaryPreventExtensions(_O_).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -41847,6 +41843,22 @@ <h1>
1. Return ~unused~.
</emu-alg>
</emu-clause>

<emu-clause id="sec-isfixedlengthtypedarray" type="abstract operation">
<h1>
IsFixedLengthTypedArray (
_O_: a TypedArray,
): a Boolean
</h1>
<dl class="header">
</dl>
<emu-alg>
1. If _O_.[[ArrayLength]] is ~auto~, return *false*.
1. Let _buffer_ be _O_.[[ViewedArrayBuffer]].
1. If IsFixedLengthArrayBuffer(_buffer_) is *false* and IsSharedArrayBuffer(_buffer_) is *false*, return *false*.
1. Return *true*.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>

Expand Down

0 comments on commit 153f59a

Please sign in to comment.