assert: improve documentation wording

Signed-off-by: Rawal27 <obviouslykamal@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64953
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Kamal Rawal authored and GitHub committed 2026-08-11 05:48:03 +00:00
1 parent cb9bb66780
commit 6a6dee3ed0
1 file changed
+4 -4
+4 -4
View File
@@ -317,7 +317,7 @@ const assert2 = new Assert({ skipPrototype: true });
assert2.deepStrictEqual(foo, bar); // OK
```
When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior
When destructured, methods lose access to the instance's `this` context and revert to the default assertion behavior
(diff: 'simple', non-strict mode).
To maintain custom options when using destructured methods, avoid
destructuring and call methods directly on the instance.
@@ -423,8 +423,8 @@ are also recursively evaluated by the following rules.
### Comparison details
* Primitive values are compared with the [`==` operator][],
with the exception of {NaN}. It is treated as being identical in case
both sides are {NaN}.
except for {NaN}, which is treated as identical when both
sides are {NaN}.
* [Type tags][Object.prototype.toString()] of objects should be the same.
* Only [enumerable "own" properties][] are considered.
* Object constructors are compared when available.
@@ -938,7 +938,7 @@ error messages as expressive as possible.
If specified, `error` can be a [`Class`][], {RegExp} or a validation
function. See [`assert.throws()`][] for more details.
Besides the async nature to await the completion behaves identically to
Aside from asynchronously awaiting completion, it behaves identically to
[`assert.doesNotThrow()`][].
```mjs