-
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: introduce CanonicalizeKeyedCollectionKey #3337
Conversation
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.
Oooh, nice!
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.
Thanks! This could also be used by the related algorithms that currently rely upon SameValueZero.
1. For each element _e_ of …, do
- 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, …
+ 1. If _e_ is not ~empty~ and CanonicalizeKeyedCollectionKey(_value_) is _e_, …
or
1. For each element _e_ of …, do
- 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, …
+ 1. If CanonicalizeKeyedCollectionKey(_value_) is _e_, …
I like this AO, but that specific suggestion seems like it'd reduce clarity to me - i'd think it'd be better to retain separate "canonicalize" and "comparison" AOs. |
@gibson042 I certainly wouldn't want to replace all uses of |
Done, though I've written it as canonicalizing before the loop rather than in every step of the loop. It's technically slightly redundant to write |
7fee271
to
30257dd
Compare
(apply editorial convention to recently-merged PR tc39#3337)
Per #3306 (comment).