-
Notifications
You must be signed in to change notification settings - Fork 30.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
doc: WeakSet
and WeakMap
comparison details
#56648
doc: WeakSet
and WeakMap
comparison details
#56648
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.
lgtm
Landed in 7bc2946 |
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.
Thank you for the PR!
While this is already merged, a few outputs seem to be a bit off. I guess it's not critical, since the overall meaning will still be there.
// + WeakSet { <items unknown> } | ||
// - WeakSet { <items unknown> } |
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.
// + WeakSet { <items unknown> } | |
// - WeakSet { <items unknown> } | |
// WeakSet { | |
// <items unknown> | |
// } |
weakSet2.add(obj); | ||
|
||
// Comparing different instances fails, even with same contents | ||
assert.deepStrictEqual(weakSet1, weakSet2); | ||
// AssertionError: Expected inputs to be strictly deep-equal: |
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.
// AssertionError: Expected inputs to be strictly deep-equal: | |
// AssertionError: Values have same structure but are not reference-equal: |
weakSet2.add(obj); | ||
|
||
// Comparing different instances fails, even with same contents | ||
assert.deepStrictEqual(weakSet1, weakSet2); | ||
// AssertionError: Expected inputs to be strictly deep-equal: |
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.
// AssertionError: Expected inputs to be strictly deep-equal: | |
// AssertionError: Values have same structure but are not reference-equal: |
// + WeakSet { <items unknown> } | ||
// - WeakSet { <items unknown> } |
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.
// + WeakSet { <items unknown> } | |
// - WeakSet { <items unknown> } | |
// WeakSet { | |
// <items unknown> | |
// } |
Thanks for the review @BridgeAR! My bad, not sure if I forgot pushing some commit, but I can create another PR real quick addressing the requested changes. |
This PR updates the documentation of the comparison details of the
WeakMap
andWeakSet
as per the current behavior.Fixes #56640