Uh oh!
There was an error while loading. Please reload this page.
doc: mention prototype check in deepStrictEqual() - #5367
Conversation
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: nodejs#5365
cjihrig
commented
Feb 23, 2016
R=@nodejs/documentation |
eljefedelrodeodeljefe
commented
Feb 23, 2016
LGTM |
benjamingr
commented
Feb 23, 2016
I'm not sure I would understand what "object prototypes are included in the comparison" means - it might imply they need to have the same |
cjihrig
commented
Feb 23, 2016
What about this? |
benjamingr
commented
Feb 23, 2016
That might still imply that their prototypes are checked and are expected to be equal (is that the case?) - what about:
|
cjihrig
commented
Feb 23, 2016
It's actually a strict comparison of the prototypes. https://github.com/nodejs/node/blob/master/lib/assert.js#L199 |
benjamingr
commented
Feb 23, 2016
@cjihrig Oh, in that case my bad - LGTM |
| values are compared using the strict equality operator ( `===` ). | ||
| Generally identical to [`assert.deepEqual()`][] with the exceptions that | ||
| primitive values are compared using the strict equality operator ( `===` ), and | ||
| object prototypes are included in the comparison. |
There was a problem hiding this comment.
object prototypes are included in the comparison.
seems a little vague to me.
There was a problem hiding this comment.
See proposed change in the main thread.
There was a problem hiding this comment.
it would have been better if we could somehow say that prototypes should be the same. But yeah the proposed change also is okay.
thefourtheye
commented
Feb 23, 2016
LGTM |
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>
cjihrig
commented
Feb 23, 2016
Thanks for the reviews. Landed in 10f55b0. |
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>
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>
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>
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>
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>
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