Skip to content

Commit 168abb5

Browse files
eyqstargos
authored andcommitted
doc: rename stackStartFunction in assert.md
[assert.js](https://github.com/nodejs/node/blob/master/lib/assert.js) uses `stackStartFn` everywhere instead of `stackStartFunction`. This also increases consistency with `stackStartFn` in the `AssertionError` options. PR-URL: #22077 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 5a4abba commit 168abb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/assert.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ assert.fail(new TypeError('need array'));
587587
Using `assert.fail()` with more than two arguments is possible but deprecated.
588588
See below for further details.
589589

590-
## assert.fail(actual, expected[, message[, operator[, stackStartFunction]]])
590+
## assert.fail(actual, expected[, message[, operator[, stackStartFn]]])
591591
<!-- YAML
592592
added: v0.1.21
593593
changes:
@@ -600,7 +600,7 @@ changes:
600600
* `expected` {any}
601601
* `message` {string|Error}
602602
* `operator` {string} **Default:** `'!='`
603-
* `stackStartFunction` {Function} **Default:** `assert.fail`
603+
* `stackStartFn` {Function} **Default:** `assert.fail`
604604

605605
> Stability: 0 - Deprecated: Use `assert.fail([message])` or other assert
606606
> functions instead.
@@ -610,7 +610,7 @@ If `message` is falsy, the error message is set as the values of `actual` and
610610
`expected` arguments are provided, `operator` will default to `'!='`. If
611611
`message` is provided as third argument it will be used as the error message and
612612
the other arguments will be stored as properties on the thrown object. If
613-
`stackStartFunction` is provided, all stack frames above that function will be
613+
`stackStartFn` is provided, all stack frames above that function will be
614614
removed from stacktrace (see [`Error.captureStackTrace`]). If no arguments are
615615
given, the default message `Failed` will be used.
616616

@@ -636,7 +636,7 @@ assert.fail(1, 2, new TypeError('need array'));
636636
In the last three cases `actual`, `expected`, and `operator` have no
637637
influence on the error message.
638638

639-
Example use of `stackStartFunction` for truncating the exception's stacktrace:
639+
Example use of `stackStartFn` for truncating the exception's stacktrace:
640640

641641
```js
642642
function suppressFrame() {

0 commit comments

Comments
 (0)