Skip to content
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: fix inconsistencies in WeakSet and WeakMap comparison details #56683

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,12 @@ weakSet2.add(obj);

// Comparing different instances fails, even with same contents
assert.deepStrictEqual(weakSet1, weakSet2);
// AssertionError: Expected inputs to be strictly deep-equal:
// AssertionError: Values have same structure but are not reference-equal:
// + actual - expected
//
// + WeakSet { <items unknown> }
// - WeakSet { <items unknown> }
// WeakSet {
// <items unknown>
// }

// Comparing the same instance to itself succeeds
assert.deepStrictEqual(weakSet1, weakSet1);
Expand Down Expand Up @@ -1018,11 +1019,12 @@ weakSet2.add(obj);

// Comparing different instances fails, even with same contents
assert.deepStrictEqual(weakSet1, weakSet2);
// AssertionError: Expected inputs to be strictly deep-equal:
// AssertionError: Values have same structure but are not reference-equal:
// + actual - expected
//
// + WeakSet { <items unknown> }
// - WeakSet { <items unknown> }
// WeakSet {
// <items unknown>
// }

// Comparing the same instance to itself succeeds
assert.deepStrictEqual(weakSet1, weakSet1);
Expand Down
Loading