Skip to content

Commit

Permalink
doc: fix inconsistencies in WeakSet and WeakMap comparison details
Browse files Browse the repository at this point in the history
PR-URL: #56683
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Jason Zhang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
ishon19 authored Jan 23, 2025
1 parent a1c9c1a commit 3d861c4
Showing 1 changed file with 8 additions and 6 deletions.
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

0 comments on commit 3d861c4

Please sign in to comment.