Skip to content

Commit

Permalink
spec: fix isValidTupleIndex (#356)
Browse files Browse the repository at this point in the history
* spec: fix isValidTupleIndex
  • Loading branch information
acutmore authored Sep 6, 2022
1 parent ce434c8 commit 722c44d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions spec/ordinary-and-exotic-object-behaviours.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,16 @@ <h1>
<ins>
IsValidTupleIndex (
_T_: a Tuple object,
_numericIndex_: an integral Number,
_index_: a Number,
): a Boolean
</ins>
</h1>
<dl class="header"></dl>
<dl class="header">
</dl>
<emu-alg>
1. If _numericIndex_ is *-0*<sub>𝔽</sub>, return *false*.
1. If ℝ(_numericIndex_) &lt; 0 or ℝ(_numericIndex_) &ge; the length of _T_.[[TupleData]].[[Sequence]], return *false*.
1. If IsIntegralNumber(_index_) is *false*, return *false*.
1. If _index_ is *-0*<sub>𝔽</sub>, return *false*.
1. If ℝ(_index_) &lt; 0 or ℝ(_index_) &ge; the length of _T_.[[TupleData]].[[Sequence]], return *false*.
1. Return *true*.
</emu-alg>
</emu-clause>
Expand All @@ -396,15 +398,15 @@ <h1>
<ins>
TupleGet (
_T_: a Tuple object,
_numericIndex_: an integral Number,
_index_: a Number,
): an ECMAScript language value
</ins>
</h1>
<dl class="header"></dl>
<emu-alg>
1. Let _tup_ be _T_.[[TupleData]].
1. If IsValidTupleIndex(_T_, _numericIndex_) is *false*, return ~empty~.
1. Let _value_ be the element with index ℝ(_numericIndex_) in _tup_.[[Sequence]].
1. If IsValidTupleIndex(_T_, _index_) is *false*, return ~empty~.
1. Let _value_ be the element with index ℝ(_index_) in _tup_.[[Sequence]].
1. Return _value_.
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 722c44d

Please sign in to comment.