-
-
Notifications
You must be signed in to change notification settings - Fork 69
Implement Upsert (Stage 2.7) #290
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
Conversation
src/intrinsics/MapPrototype.mts
Outdated
// a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]]. | ||
if (p.Key !== undefined && SameValueZero(p.Key, key) === Value.true) { |
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.
Is it SV or SVZ? Comment and the code are conflict
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.
It's SV, thanks for catching that.
src/intrinsics/MapPrototype.mts
Outdated
if (key instanceof NumberValue && Object.is(R(key), -0)) { | ||
key = F(+0); | ||
} |
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.
and you should call CanonicalizeKeyedCollectionKey
you just added 👀
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.
Oops, thanks for catching that
This implementation passes the tests at tc39/test262#4454.