diff options
author | cjihrig <cjihrig@gmail.com> | 2019-01-07 13:19:49 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-01-10 09:00:17 -0500 |
commit | a665d13ad9fe40092be74d32652c1301b1db7550 (patch) | |
tree | 681840fed2173a0bc7a9fb5c322c6f07755c87ba | |
parent | 10df21b0714daae8ec9b1507e77bab7ae07e8fa7 (diff) | |
download | android-node-v8-a665d13ad9fe40092be74d32652c1301b1db7550.tar.gz android-node-v8-a665d13ad9fe40092be74d32652c1301b1db7550.tar.bz2 android-node-v8-a665d13ad9fe40092be74d32652c1301b1db7550.zip |
lib: move DEP0028 to end of life
PR-URL: https://github.com/nodejs/node/pull/25377
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
-rw-r--r-- | doc/api/deprecations.md | 9 | ||||
-rw-r--r-- | doc/api/util.md | 12 | ||||
-rw-r--r-- | lib/util.js | 8 | ||||
-rw-r--r-- | test/fixtures/deprecated.js | 8 | ||||
-rw-r--r-- | test/parallel/test-util.js | 2 | ||||
-rw-r--r-- | test/sequential/test-deprecation-flags.js | 10 |
6 files changed, 16 insertions, 33 deletions
diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index b6ec7fb721..eef4afdd03 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -611,6 +611,9 @@ Type: End-of-Life ### DEP0028: util.debug() <!-- YAML changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/xxxxx + description: End-of-Life. - version: - v4.8.6 - v6.12.0 @@ -621,10 +624,9 @@ changes: description: Runtime deprecation. --> -Type: Runtime +Type: End-of-Life -The [`util.debug()`][] API is deprecated. Please use [`console.error()`][] -instead. +`util.debug()` has been removed. Please use [`console.error()`][] instead. <a id="DEP0029"></a> ### DEP0029: util.error() @@ -2395,7 +2397,6 @@ Setting the TLS ServerName to an IP address is not permitted by [`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost [`url.resolve()`]: url.html#url_url_resolve_from_to [`util._extend()`]: util.html#util_util_extend_target_source -[`util.debug()`]: util.html#util_util_debug_string [`util.error()`]: util.html#util_util_error_strings [`util.getSystemErrorName()`]: util.html#util_util_getsystemerrorname_err [`util.inspect()`]: util.html#util_util_inspect_object_options diff --git a/doc/api/util.md b/doc/api/util.md index cdfaf4bdca..e5543d189c 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1714,18 +1714,6 @@ Node.js modules. The community found and used it anyway. It is deprecated and should not be used in new code. JavaScript comes with very similar built-in functionality through [`Object.assign()`]. -### util.debug(string) -<!-- YAML -added: v0.3.0 -deprecated: v0.11.3 ---> - -> Stability: 0 - Deprecated: Use [`console.error()`][] instead. - -* `string` {string} The message to print to `stderr` - -Deprecated predecessor of `console.error`. - ### util.error([...strings]) <!-- YAML added: v0.3.0 diff --git a/lib/util.js b/lib/util.js index 1cb113bad1..160904d28a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -325,11 +325,6 @@ function _extend(target, source) { } // Deprecated old stuff. - -function debug(x) { - process.stderr.write(`DEBUG: ${x}\n`); -} - function error(...args) { for (var i = 0, len = args.length; i < len; ++i) { process.stderr.write(`${args[i]}\n`); @@ -429,9 +424,6 @@ module.exports = exports = { types, // Deprecated Old Stuff - debug: deprecate(debug, - 'util.debug is deprecated. Use console.error instead.', - 'DEP0028'), error: deprecate(error, 'util.error is deprecated. Use console.error instead.', 'DEP0029') diff --git a/test/fixtures/deprecated.js b/test/fixtures/deprecated.js index f49c0d91ba..69d1ee2b0d 100644 --- a/test/fixtures/deprecated.js +++ b/test/fixtures/deprecated.js @@ -1 +1,7 @@ -require('util').debug('This is deprecated'); +'use strict'; +const util = require('util'); +const deprecated = util.deprecate(() => { + console.error('This is deprecated'); +}, 'this function is deprecated'); + +deprecated(); diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 54aaa4266f..28c4018d73 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -145,11 +145,9 @@ assert.strictEqual(util.isFunction(), false); assert.strictEqual(util.isFunction('string'), false); common.expectWarning('DeprecationWarning', [ - ['util.debug is deprecated. Use console.error instead.', 'DEP0028'], ['util.error is deprecated. Use console.error instead.', 'DEP0029'] ]); -util.debug('test'); util.error('test'); { diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index be159ceb38..dd41614f7f 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -44,7 +44,7 @@ execFile(node, normal, function(er, stdout, stderr) { console.error('normal: show deprecation warning'); assert.strictEqual(er, null); assert.strictEqual(stdout, ''); - assert(/util\.debug is deprecated/.test(stderr)); + assert(/this function is deprecated/.test(stderr)); console.log('normal ok'); }); @@ -52,7 +52,7 @@ execFile(node, noDep, function(er, stdout, stderr) { console.error('--no-deprecation: silence deprecations'); assert.strictEqual(er, null); assert.strictEqual(stdout, ''); - assert.strictEqual(stderr, 'DEBUG: This is deprecated\n'); + assert.strictEqual(stderr.trim(), 'This is deprecated'); console.log('silent ok'); }); @@ -62,10 +62,8 @@ execFile(node, traceDep, function(er, stdout, stderr) { assert.strictEqual(stdout, ''); const stack = stderr.trim().split('\n'); // just check the top and bottom. - assert( - /util\.debug is deprecated\. Use console\.error instead\./.test(stack[1]) - ); - assert(/DEBUG: This is deprecated/.test(stack[0])); + assert(/this function is deprecated/.test(stack[1])); + assert(/This is deprecated/.test(stack[0])); console.log('trace ok'); }); |