From 6f22ab8b5a7f33985c9ede0cd09cd0d1cfd6f38a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 4 Feb 2018 19:59:53 +0100 Subject: [PATCH 1/2] doc,assert,timers: assign deprecation codes Overlooked when landing the respective PRs. --- doc/api/deprecations.md | 15 ++++++++------- lib/assert.js | 2 +- lib/timers.js | 4 ++-- test/parallel/test-timers-max-duration-warning.js | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ec7a79a2955593..a9de845146e956 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -840,15 +840,16 @@ 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. + +### DEP0093: crypto.fips is deprecated and replaced. Type: Documentation-only The [`crypto.fips`][] property is deprecated. Please use `crypto.setFips()` and `crypto.getFips()` instead. - -### DEP0XXX: Using `assert.fail()` with more than one argument. + +### DEP0094: Using `assert.fail()` with more than one argument. Type: Runtime @@ -856,15 +857,15 @@ 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. - -### DEP00XX: timers.enroll() + +### DEP0095: timers.enroll() Type: Runtime `timers.enroll()` is deprecated. Please use the publicly documented [`setTimeout()`][] or [`setInterval()`][] instead. - -### DEP00XX: timers.unenroll() + +### DEP0096: timers.unenroll() Type: Runtime diff --git a/lib/assert.js b/lib/assert.js index 75d2473c486261..2e21085f5f4a95 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -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) diff --git a/lib/timers.js b/lib/timers.js index 79fc432dcdf3d7..0fac2189cafd76 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -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. @@ -377,7 +377,7 @@ function enroll(item, msecs) { exports.enroll = util.deprecate(enroll, 'timers.unenroll() is deprecated. ' + 'Please use clearTimeout instead.', - 'DEP00XX'); + 'DEP0095'); /* diff --git a/test/parallel/test-timers-max-duration-warning.js b/test/parallel/test-timers-max-duration-warning.js index 1fc17b97419193..c978cf29c3fe4d 100644 --- a/test/parallel/test-timers-max-duration-warning.js +++ b/test/parallel/test-timers-max-duration-warning.js @@ -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)); { From 071f645004e86da6ce61c2fbbc3083d73515cf8d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 4 Feb 2018 23:10:59 +0100 Subject: [PATCH 2/2] [squash] fix deprecation warning text --- lib/timers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/timers.js b/lib/timers.js index 0fac2189cafd76..b4c27fbeb9bf89 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -375,7 +375,7 @@ function enroll(item, msecs) { } exports.enroll = util.deprecate(enroll, - 'timers.unenroll() is deprecated. ' + + 'timers.enroll() is deprecated. ' + 'Please use clearTimeout instead.', 'DEP0095');