Skip to content

Commit

Permalink
doc: rename stackStartFunction in assert.md
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
eyqs authored and targos committed Aug 2, 2018
1 parent 5a4abba commit 168abb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ assert.fail(new TypeError('need array'));
Using `assert.fail()` with more than two arguments is possible but deprecated.
See below for further details.

## assert.fail(actual, expected[, message[, operator[, stackStartFunction]]])
## assert.fail(actual, expected[, message[, operator[, stackStartFn]]])
<!-- YAML
added: v0.1.21
changes:
Expand All @@ -600,7 +600,7 @@ changes:
* `expected` {any}
* `message` {string|Error}
* `operator` {string} **Default:** `'!='`
* `stackStartFunction` {Function} **Default:** `assert.fail`
* `stackStartFn` {Function} **Default:** `assert.fail`

> Stability: 0 - Deprecated: Use `assert.fail([message])` or other assert
> functions instead.
Expand All @@ -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
`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
`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
given, the default message `Failed` will be used.

Expand All @@ -636,7 +636,7 @@ assert.fail(1, 2, new TypeError('need array'));
In the last three cases `actual`, `expected`, and `operator` have no
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
function suppressFrame() {
Expand Down

0 comments on commit 168abb5

Please sign in to comment.