Skip to content

Commit

Permalink
doc,assert,timers: assign deprecation codes
Browse files Browse the repository at this point in the history
Overlooked when landing the respective PRs.

PR-URL: nodejs#18564
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
  • Loading branch information
addaleax authored and BridgeAR committed Feb 6, 2018
1 parent 9686d87 commit 82a7347
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
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

0 comments on commit 82a7347

Please sign in to comment.