Skip to content

Commit

Permalink
Editorial: splice: consolidate redundant count variables (tc39#2732)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 13, 2022
1 parent e7979fd commit 246b77b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -37934,15 +37934,15 @@ <h1>Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )</h1>
1. If _relativeStart_ is -&infin;, let _actualStart_ be 0.
1. Else if _relativeStart_ &lt; 0, let _actualStart_ be max(_len_ + _relativeStart_, 0).
1. Else, let _actualStart_ be min(_relativeStart_, _len_).
1. Let _insertCount_ be the number of elements in _items_.
1. Let _itemCount_ be the number of elements in _items_.
1. If _start_ is not present, then
1. Let _actualDeleteCount_ be 0.
1. Else if _deleteCount_ is not present, then
1. Let _actualDeleteCount_ be _len_ - _actualStart_.
1. Else,
1. Let _dc_ be ? ToIntegerOrInfinity(_deleteCount_).
1. Let _actualDeleteCount_ be the result of clamping _dc_ between 0 and _len_ - _actualStart_.
1. If _len_ + _insertCount_ - _actualDeleteCount_ &gt; 2<sup>53</sup> - 1, throw a *TypeError* exception.
1. If _len_ + _itemCount_ - _actualDeleteCount_ &gt; 2<sup>53</sup> - 1, throw a *TypeError* exception.
1. Let _A_ be ? ArraySpeciesCreate(_O_, _actualDeleteCount_).
1. Let _k_ be 0.
1. Repeat, while _k_ &lt; _actualDeleteCount_,
Expand All @@ -37952,7 +37952,6 @@ <h1>Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )</h1>
1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_k_)), _fromValue_).
1. Set _k_ to _k_ + 1.
1. Perform ? Set(_A_, *"length"*, 𝔽(_actualDeleteCount_), *true*).
1. Let _itemCount_ be the number of elements in _items_.
1. If _itemCount_ &lt; _actualDeleteCount_, then
1. Set _k_ to _actualStart_.
1. Repeat, while _k_ &lt; (_len_ - _actualDeleteCount_),
Expand Down

0 comments on commit 246b77b

Please sign in to comment.