Skip to content

Commit

Permalink
doc: revise assert legacy mode text
Browse files Browse the repository at this point in the history
Revise the text for the `assert` module's legacy mode to make it simpler
and more scannable.

PR-URL: #28315
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Trott authored and targos committed Jul 2, 2019
1 parent b448db3 commit 51742b8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,21 @@ Please note that this will also deactivate the colors in the REPL.

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

It can be accessed using:
* [`assert.deepEqual()`][]
* [`assert.equal()`][]
* [`assert.notDeepEqual()`][]
* [`assert.notEqual()`][]

To use legacy mode:

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

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

Expand Down

0 comments on commit 51742b8

Please sign in to comment.