Skip to content

Commit 66cb818

Browse files
tniessenjuanarbol
authored andcommitted
doc: use serial comma in assert docs
Refs: #11321 Refs: #17384 PR-URL: #43154 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parent 3f799c4 commit 66cb818

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/api/assert.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,8 @@ are also recursively evaluated by the following rules.
535535
objects.
536536
* [`Symbol`][] properties are not compared.
537537
* [`WeakMap`][] and [`WeakSet`][] comparison does not rely on their values.
538+
* [`RegExp`][] lastIndex, flags, and source are always compared, even if these
539+
are not enumerable properties.
538540

539541
The following example does not throw an [`AssertionError`][] because the
540542
primitives are compared using the [`==` operator][].
@@ -691,6 +693,8 @@ are recursively evaluated also by the following rules.
691693
reference.
692694
* [`WeakMap`][] and [`WeakSet`][] comparison does not rely on their values. See
693695
below for further details.
696+
* [`RegExp`][] lastIndex, flags, and source are always compared, even if these
697+
are not enumerable properties.
694698

695699
```mjs
696700
import assert from 'node:assert/strict';
@@ -958,7 +962,7 @@ benefit in catching a rejection and then rejecting it again. Instead, consider
958962
adding a comment next to the specific code path that should not reject and keep
959963
error messages as expressive as possible.
960964

961-
If specified, `error` can be a [`Class`][], [`RegExp`][] or a validation
965+
If specified, `error` can be a [`Class`][], [`RegExp`][], or a validation
962966
function. See [`assert.throws()`][] for more details.
963967

964968
Besides the async nature to await the completion behaves identically to
@@ -1040,7 +1044,7 @@ parameter, then an [`AssertionError`][] is thrown. If the error is of a
10401044
different type, or if the `error` parameter is undefined, the error is
10411045
propagated back to the caller.
10421046

1043-
If specified, `error` can be a [`Class`][], [`RegExp`][] or a validation
1047+
If specified, `error` can be a [`Class`][], [`RegExp`][], or a validation
10441048
function. See [`assert.throws()`][] for more details.
10451049

10461050
The following, for instance, will throw the [`TypeError`][] because there is no

0 commit comments

Comments
 (0)