lib: move DEP0027 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>
This commit is contained in:
parent
2d578ad996
commit
10df21b071
@ -590,6 +590,9 @@ Type: End-of-Life
|
||||
### DEP0027: util.puts()
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/xxxxx
|
||||
description: End-of-Life.
|
||||
- version:
|
||||
- v4.8.6
|
||||
- v6.12.0
|
||||
@ -600,9 +603,9 @@ changes:
|
||||
description: Runtime deprecation.
|
||||
-->
|
||||
|
||||
Type: Runtime
|
||||
Type: End-of-Life
|
||||
|
||||
The [`util.puts()`][] API is deprecated. Please use [`console.log()`][] instead.
|
||||
`util.puts()` has been removed. Please use [`console.log()`][] instead.
|
||||
|
||||
<a id="DEP0028"></a>
|
||||
### DEP0028: util.debug()
|
||||
@ -2413,7 +2416,6 @@ Setting the TLS ServerName to an IP address is not permitted by
|
||||
[`util.isSymbol()`]: util.html#util_util_issymbol_object
|
||||
[`util.isUndefined()`]: util.html#util_util_isundefined_object
|
||||
[`util.log()`]: util.html#util_util_log_string
|
||||
[`util.puts()`]: util.html#util_util_puts_strings
|
||||
[`util.types`]: util.html#util_util_types
|
||||
[`util`]: util.html
|
||||
[`worker.exitedAfterDisconnect`]: cluster.html#cluster_worker_exitedafterdisconnect
|
||||
|
@ -2167,16 +2167,6 @@ const util = require('util');
|
||||
util.log('Timestamped message.');
|
||||
```
|
||||
|
||||
### util.puts([...strings])
|
||||
<!-- YAML
|
||||
added: v0.3.0
|
||||
deprecated: v0.11.3
|
||||
-->
|
||||
|
||||
> Stability: 0 - Deprecated: Use [`console.log()`][] instead.
|
||||
|
||||
Deprecated predecessor of `console.log`.
|
||||
|
||||
[`'uncaughtException'`]: process.html#process_event_uncaughtexception
|
||||
[`'warning'`]: process.html#process_event_warning
|
||||
[`Array.isArray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
||||
@ -2207,7 +2197,6 @@ Deprecated predecessor of `console.log`.
|
||||
[`WebAssembly.Module`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module
|
||||
[`assert.deepStrictEqual()`]: assert.html#assert_assert_deepstrictequal_actual_expected_message
|
||||
[`console.error()`]: console.html#console_console_error_data_args
|
||||
[`console.log()`]: console.html#console_console_log_data_args
|
||||
[`target` and `handler`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#Terminology
|
||||
[`util.format()`]: #util_util_format_format_args
|
||||
[`util.inspect()`]: #util_util_inspect_object_options
|
||||
|
11
lib/util.js
11
lib/util.js
@ -326,12 +326,6 @@ function _extend(target, source) {
|
||||
|
||||
// Deprecated old stuff.
|
||||
|
||||
function puts(...args) {
|
||||
for (var i = 0, len = args.length; i < len; ++i) {
|
||||
process.stdout.write(`${args[i]}\n`);
|
||||
}
|
||||
}
|
||||
|
||||
function debug(x) {
|
||||
process.stderr.write(`DEBUG: ${x}\n`);
|
||||
}
|
||||
@ -440,8 +434,5 @@ module.exports = exports = {
|
||||
'DEP0028'),
|
||||
error: deprecate(error,
|
||||
'util.error is deprecated. Use console.error instead.',
|
||||
'DEP0029'),
|
||||
puts: deprecate(puts,
|
||||
'util.puts is deprecated. Use console.log instead.',
|
||||
'DEP0027')
|
||||
'DEP0029')
|
||||
};
|
||||
|
@ -145,12 +145,10 @@ assert.strictEqual(util.isFunction(), false);
|
||||
assert.strictEqual(util.isFunction('string'), false);
|
||||
|
||||
common.expectWarning('DeprecationWarning', [
|
||||
['util.puts is deprecated. Use console.log instead.', 'DEP0027'],
|
||||
['util.debug is deprecated. Use console.error instead.', 'DEP0028'],
|
||||
['util.error is deprecated. Use console.error instead.', 'DEP0029']
|
||||
]);
|
||||
|
||||
util.puts('test');
|
||||
util.debug('test');
|
||||
util.error('test');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user