Skip to content

Commit 9bdeabc

Browse files
committed
doc: fix inconsistencies in WeakSet and WeakMap comparison details
1 parent 23c2d33 commit 9bdeabc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/api/assert.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,12 @@ weakSet2.add(obj);
909909

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

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

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

10271029
// Comparing the same instance to itself succeeds
10281030
assert.deepStrictEqual(weakSet1, weakSet1);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy