| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
|
R=@nodejs/documentation |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
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 __proto__. |
Sorry, something went wrong.
|
What about this? Generally identical to `assert.deepEqual()` with two exceptions. First, primitive values are compared using the strict equality operator ( `===` ). Second, object comparisons include a strict equality check of their prototypes. |
Sorry, something went wrong.
|
That might still imply that their prototypes are checked and are expected to be equal (is that the case?) - what about:
|
Sorry, something went wrong.
|
It's actually a strict comparison of the prototypes. https://github.com/nodejs/node/blob/master/lib/assert.js#L199 |
Sorry, something went wrong.
| 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.
Sorry, something went wrong.
There was a problem hiding this comment.
See proposed change in the main thread.
Sorry, something went wrong.
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.
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
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>
|
Thanks for the reviews. Landed in 10f55b0. |
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
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