-
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: Using is -0
instead of = -0
in StringGetOwnProperty
#1963
Conversation
There's a few other cases of (Also, note the overlap with #1086) |
I'm confusing to understand the conversations in #1086.
Am I right? |
In general, there's a lot of implicitness around Number and mathematical values in the spec; this seems like it may be one of those cases. |
@ljharb I think that However, I believe that the |
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.
This seems like a good fix to me. In the scheme of things like =
relating to mathematical values, I see = -0
being the same as = 0
, whereas is
implies SameValue
. @caiolima is working on a fixup for mathematical values in general based on discussion in #1964 ; I'd be fine with either waiting for that or landing this independently.
I am in favor of this change. Specifically, for the case of comparing ECMAScript values to the ECMAScript values |
I revised a small part in
StringGetOwnProperty
to useis -0
instead of= -0
to correctly represent the semantics. The expressionindex = -0
denotes thatindex
is-0
or+0
because the=
operator is floating point equality operator. Thus, instead, I think that it should be revised toindex is -0
.