Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: adds assert doc for strict mode with pointer to strict equality #30486

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/api/assert.md
Expand Up @@ -82,7 +82,9 @@ changes:

In `strict` mode, `assert` functions use the comparison in the corresponding
shobhitchittora marked this conversation as resolved.
Show resolved Hide resolved
strict functions. For example, [`assert.deepEqual()`][] will behave like
[`assert.deepStrictEqual()`][].
[`assert.deepStrictEqual()`][]. This uses the [Strict Equality Comparison][]
shobhitchittora marked this conversation as resolved.
Show resolved Hide resolved
from the ECMAScript spec and does not refer to JavaScript strict
mode (`"use strict";`) in any way.

In `strict` mode, error messages for objects display a diff. In legacy mode,
error messages for objects display the objects, often truncated.
Expand Down Expand Up @@ -1319,6 +1321,7 @@ second argument. This might lead to difficult-to-spot errors.
[`assert.throws()`]: #assert_assert_throws_fn_error_message
[`strict` mode]: #assert_strict_mode
[Abstract Equality Comparison]: https://tc39.github.io/ecma262/#sec-abstract-equality-comparison
[Strict Equality Comparison]: https://tc39.es/ecma262/#sec-strict-equality-comparison
[Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript
[Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring
[SameValue Comparison]: https://tc39.github.io/ecma262/#sec-samevalue
Expand Down