Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
clarify possible/impossible abrupt completions
Browse files Browse the repository at this point in the history
  • Loading branch information
acutmore committed Feb 16, 2022
1 parent acec2f8 commit d1fe2de
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h1>%TypedArray%.prototype.toSorted ( _compareFn_ )</h1>
1. Let _k_ be 0.
1. Repeat, while _k_ &lt; _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
1. Let _kValue_ be ? Get(_O_, _Pk_).
1. Let _kValue_ be ! Get(_O_, _Pk_).
1. Append _kValue_ to _items_.
1. Set _k_ to _k_ + 1.
1. Sort _items_ using an implementation-defined sequence of calls to SortCompare. If any such call returns an abrupt completion, stop before performing any further calls to SortCompare or steps in this algorithm and return that completion.
Expand Down Expand Up @@ -293,7 +293,7 @@ <h1>%TypedArray%.prototype.toSpliced ( _start_, _deleteCount_, ..._items_ )</h1>
1. Set _i_ to _i_ + 1.
1. For each element _E_ of _items_, do
1. Let _Pi_ be ! ToString(𝔽(_i_)).
1. Perform ? Set(_A_, _Pi_, _E_, *true*).
1. [id="step-typedarray-tospliced-set"] Perform ? Set(_A_, _Pi_, _E_, *true*).
1. Set _i_ to _i_ + 1.
1. Repeat, while _r_ &lt; _newLen_,
1. Let _Pi_ be ! ToString(𝔽(_i_)).
Expand All @@ -304,6 +304,9 @@ <h1>%TypedArray%.prototype.toSpliced ( _start_, _deleteCount_, ..._items_ )</h1>
1. Set _r_ to _r_ + 1.
1. Return _A_.
</emu-alg>
<emu-note>
Step <emu-xref href="#step-typedarray-tospliced-set"></emu-xref> may return an abrupt completion because _E_ is a value of any ECMAScript language type and is passed to ToBigInt or ToNumber.
</emu-note>
</emu-clause>

<emu-clause id="sec-%typedarray%.prototype.with">
Expand All @@ -323,12 +326,17 @@ <h1>%TypedArray%.prototype.with ( _index_, _value_ )</h1>
1. Let _k_ be 0.
1. Repeat, while _k_ &lt; _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
1. If _k_ is _actualIndex_, let _fromValue_ be _value_.
1. Else, let _fromValue_ be ! Get(_O_, _Pk_).
1. Perform ? Set(_A_, _Pk_, _fromValue_, *true*).
1. If _k_ is _actualIndex_, then
1. [id="step-typedarray-with-set"] Perform ? Set(_A_, _Pk_, _value_, *true*).
1. Else,
1. Let _fromValue_ be ! Get(_O_, _Pk_).
1. Perform ! Set(_A_, _Pk_, _fromValue_, *true*).
1. Set _k_ to _k_ + 1.
1. Return _A_.
</emu-alg>
<emu-note>
Step <emu-xref href="#step-typedarray-with-set"></emu-xref> may return an abrupt completion because _value_ is a value of any ECMAScript language type and is passed to ToBigInt or ToNumber.
</emu-note>
</emu-clause>
</emu-clause>
</emu-clause>
Expand Down

0 comments on commit d1fe2de

Please sign in to comment.