Skip to content

Commit 8c469fa

Browse files
cjihrigrvagg
authored andcommitted
doc: mention prototype check in deepStrictEqual()
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: #5365 PR-URL: #5367 Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
1 parent ec459ee commit 8c469fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/assert.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ parameter is undefined, a default error message is assigned.
8989

9090
## assert.deepStrictEqual(actual, expected[, message])
9191

92-
Generally identical to [`assert.deepEqual()`][] with the exception that primitive
93-
values are compared using the strict equality operator ( `===` ).
92+
Generally identical to `assert.deepEqual()` with two exceptions. First,
93+
primitive values are compared using the strict equality operator ( `===` ).
94+
Second, object comparisons include a strict equality check of their prototypes.
9495

9596
```js
9697
const assert = require('assert');

0 commit comments

Comments
 (0)