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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
a3e511b971
commit
ce98e2e989
@ -587,7 +587,7 @@ assert.fail(new TypeError('need array'));
|
|||||||
Using `assert.fail()` with more than two arguments is possible but deprecated.
|
Using `assert.fail()` with more than two arguments is possible but deprecated.
|
||||||
See below for further details.
|
See below for further details.
|
||||||
|
|
||||||
## assert.fail(actual, expected[, message[, operator[, stackStartFunction]]])
|
## assert.fail(actual, expected[, message[, operator[, stackStartFn]]])
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.1.21
|
added: v0.1.21
|
||||||
changes:
|
changes:
|
||||||
@ -600,7 +600,7 @@ changes:
|
|||||||
* `expected` {any}
|
* `expected` {any}
|
||||||
* `message` {string|Error}
|
* `message` {string|Error}
|
||||||
* `operator` {string} **Default:** `'!='`
|
* `operator` {string} **Default:** `'!='`
|
||||||
* `stackStartFunction` {Function} **Default:** `assert.fail`
|
* `stackStartFn` {Function} **Default:** `assert.fail`
|
||||||
|
|
||||||
> Stability: 0 - Deprecated: Use `assert.fail([message])` or other assert
|
> Stability: 0 - Deprecated: Use `assert.fail([message])` or other assert
|
||||||
> functions instead.
|
> functions instead.
|
||||||
@ -610,7 +610,7 @@ If `message` is falsy, the error message is set as the values of `actual` and
|
|||||||
`expected` arguments are provided, `operator` will default to `'!='`. If
|
`expected` arguments are provided, `operator` will default to `'!='`. If
|
||||||
`message` is provided as third argument it will be used as the error message and
|
`message` is provided as third argument it will be used as the error message and
|
||||||
the other arguments will be stored as properties on the thrown object. If
|
the other arguments will be stored as properties on the thrown object. If
|
||||||
`stackStartFunction` is provided, all stack frames above that function will be
|
`stackStartFn` is provided, all stack frames above that function will be
|
||||||
removed from stacktrace (see [`Error.captureStackTrace`]). If no arguments are
|
removed from stacktrace (see [`Error.captureStackTrace`]). If no arguments are
|
||||||
given, the default message `Failed` will be used.
|
given, the default message `Failed` will be used.
|
||||||
|
|
||||||
@ -636,7 +636,7 @@ assert.fail(1, 2, new TypeError('need array'));
|
|||||||
In the last three cases `actual`, `expected`, and `operator` have no
|
In the last three cases `actual`, `expected`, and `operator` have no
|
||||||
influence on the error message.
|
influence on the error message.
|
||||||
|
|
||||||
Example use of `stackStartFunction` for truncating the exception's stacktrace:
|
Example use of `stackStartFn` for truncating the exception's stacktrace:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
function suppressFrame() {
|
function suppressFrame() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user