Skip to content

Commit

Permalink
Editorial: Validate array length using SameValueZero (#2460)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacokwon authored and ljharb committed Jul 19, 2021
1 parent 37d6204 commit ee2d790
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -13728,7 +13728,7 @@ <h1>
1. Let _newLenDesc_ be a copy of _Desc_.
1. [id="step-arraysetlength-newlen"] Let _newLen_ be ? ToUint32(_Desc_.[[Value]]).
1. [id="step-arraysetlength-numberlen"] Let _numberLen_ be ? ToNumber(_Desc_.[[Value]]).
1. If _newLen_ is not the same value as _numberLen_, throw a *RangeError* exception.
1. If SameValueZero(_newLen_, _numberLen_) is *false*, throw a *RangeError* exception.
1. Set _newLenDesc_.[[Value]] to _newLen_.
1. Let _oldLenDesc_ be OrdinaryGetOwnProperty(_A_, *"length"*).
1. Assert: ! IsDataDescriptor(_oldLenDesc_) is *true*.
Expand Down Expand Up @@ -35206,7 +35206,7 @@ <h1>Array ( ..._values_ )</h1>
1. Let _intLen_ be *1*<sub>𝔽</sub>.
1. Else,
1. Let _intLen_ be ! ToUint32(_len_).
1. If _intLen_ is not the same value as _len_, throw a *RangeError* exception.
1. If SameValueZero(_intLen_, _len_) is *false*, throw a *RangeError* exception.
1. Perform ! Set(_array_, *"length"*, _intLen_, *true*).
1. Return _array_.
1. Else,
Expand Down

0 comments on commit ee2d790

Please sign in to comment.