Skip to content

Commit 68548dc

Browse files
ishon19marco-ippolito
authored andcommitted
doc: fix inconsistencies in WeakSet and WeakMap comparison details
PR-URL: #56683 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 337cfb2 commit 68548dc

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
@@ -904,11 +904,12 @@ weakSet2.add(obj);
904904

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

913914
// Comparing the same instance to itself succeeds
914915
assert.deepStrictEqual(weakSet1, weakSet1);
@@ -1013,11 +1014,12 @@ weakSet2.add(obj);
10131014

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

10221024
// Comparing the same instance to itself succeeds
10231025
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