Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc,assert,timers: assign deprecation codes #18564

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -840,31 +840,32 @@ Assigning properties to the top-level `this` as an alternative
to `module.exports` is deprecated. Developers should use `exports`
or `module.exports` instead.

### DEP00XX: crypto.fips is deprecated and replaced.
<a id="DEP0093"></a>
### DEP0093: crypto.fips is deprecated and replaced.

Type: Documentation-only

The [`crypto.fips`][] property is deprecated. Please use `crypto.setFips()`
and `crypto.getFips()` instead.

<a id="DEP0XX"></a>
### DEP0XXX: Using `assert.fail()` with more than one argument.
<a id="DEP0094"></a>
### DEP0094: Using `assert.fail()` with more than one argument.

Type: Runtime

Using `assert.fail()` with more than one argument has no benefit over writing an
individual error message. Either use `assert.fail()` with one argument or switch
to one of the other assert methods.

<a id="DEP00XX"></a>
### DEP00XX: timers.enroll()
<a id="DEP0095"></a>
### DEP0095: timers.enroll()

Type: Runtime

`timers.enroll()` is deprecated. Please use the publicly documented [`setTimeout()`][] or [`setInterval()`][] instead.

<a id="DEP00XX"></a>
### DEP00XX: timers.unenroll()
<a id="DEP0096"></a>
### DEP0096: timers.unenroll()

Type: Runtime

Expand Down
2 changes: 1 addition & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function fail(actual, expected, message, operator, stackStartFn) {
'assert.fail() with more than one argument is deprecated. ' +
'Please use assert.strictEqual() instead or only pass a message.',
'DeprecationWarning',
'DEP00XXX'
'DEP0094'
);
}
if (argsLen === 2)
Expand Down
6 changes: 3 additions & 3 deletions lib/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function unenroll(item) {
exports.unenroll = util.deprecate(unenroll,
'timers.unenroll() is deprecated. ' +
'Please use clearTimeout instead.',
'DEP00XX');
'DEP0096');


// Make a regular object able to act as a timer by setting some properties.
Expand All @@ -375,9 +375,9 @@ function enroll(item, msecs) {
}

exports.enroll = util.deprecate(enroll,
'timers.unenroll() is deprecated. ' +
'timers.enroll() is deprecated. ' +
'Please use clearTimeout instead.',
'DEP00XX');
'DEP0095');


/*
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-timers-max-duration-warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ process.on('warning', common.mustCall((warning) => {
assert.strictEqual(lines[0], `${OVERFLOW} does not fit into a 32-bit signed` +
' integer.');
assert.strictEqual(lines.length, 2);
}, 4));
}, 5));


{
Expand Down