Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 51742b8

Browse filesBrowse files
Trotttargos
authored andcommitted
doc: revise assert legacy mode text
Revise the text for the `assert` module's legacy mode to make it simpler and more scannable. PR-URL: #28315 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent b448db3 commit 51742b8
Copy full SHA for 51742b8

File tree

Expand file treeCollapse file tree

1 file changed

+9
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-6
lines changed
Open diff view settings
Collapse file

‎doc/api/assert.md‎

Copy file name to clipboardExpand all lines: doc/api/assert.md
+9-6Lines changed: 9 additions & 6 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,21 @@ Please note that this will also deactivate the colors in the REPL.
121121

122122
> Stability: 0 - Deprecated: Use strict mode instead.
123123
124-
When accessing `assert` directly instead of using the `strict` property, the
125-
[Abstract Equality Comparison][] will be used for any function without "strict"
126-
in its name, such as [`assert.deepEqual()`][].
124+
Legacy mode uses the [Abstract Equality Comparison][] in:
127125

128-
It can be accessed using:
126+
* [`assert.deepEqual()`][]
127+
* [`assert.equal()`][]
128+
* [`assert.notDeepEqual()`][]
129+
* [`assert.notEqual()`][]
130+
131+
To use legacy mode:
129132

130133
```js
131134
const assert = require('assert');
132135
```
133136

134-
It is recommended to use the [`strict` mode][] instead as the
135-
[Abstract Equality Comparison][] can often have surprising results. This is
137+
Whenever possible, use the [`strict` mode][] instead. Otherwise, the
138+
[Abstract Equality Comparison][] may cause surprising results. This is
136139
especially true for [`assert.deepEqual()`][], where the comparison rules are
137140
lax:
138141

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.