-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editorial: Validate array length using SameValueZero
in ArraySetLength
and Array
#2460
Conversation
A quick question - 23.1.1.1's step |
Since |
f6d3266
to
58a0c1c
Compare
ArraySetLength
SameValue
in ArraySetLength
and Array
Of course. I've applied the changes and updated the PR, let me know what you think! |
SameValue
in ArraySetLength
and Array
SameValueZero
in ArraySetLength
and Array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Once another editor approves we'll land this. Thanks for the contribution!
58a0c1c
to
ee2d790
Compare
I believe that the
≠
(≠) notation should be used when comparing array lengths in 10.4.2.4 ArraySetLength's step5
.According to test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-127.js, a
RangeError
must not be thrown, meaning thatnewLen
andnumberLen
, which are0
and-0.0
in this case, should be "the same value".From what I've seen in #1963 and one of the discussions when the phrase "the same value" was first introduced, the likes of
=
,≠
seem to be used for mathematical equality, which is what I think is a more suitable notation to express the comparison.