lib: move DEP0026 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:
cjihrig 2019-01-07 12:42:17 -05:00
parent dce2f3ed93
commit 2d578ad996
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
6 changed files with 7 additions and 27 deletions

View File

@ -569,6 +569,9 @@ The `sys` module is deprecated. Please use the [`util`][] module instead.
### DEP0026: util.print()
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/xxxxx
description: End-of-Life.
- version:
- v4.8.6
- v6.12.0
@ -579,10 +582,9 @@ changes:
description: Runtime deprecation.
-->
Type: Runtime
Type: End-of-Life
The [`util.print()`][] API is deprecated. Please use [`console.log()`][]
instead.
`util.print()` has been removed. Please use [`console.log()`][] instead.
<a id="DEP0027"></a>
### DEP0027: util.puts()
@ -2411,7 +2413,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.print()`]: util.html#util_util_print_strings
[`util.puts()`]: util.html#util_util_puts_strings
[`util.types`]: util.html#util_util_types
[`util`]: util.html

View File

@ -2167,16 +2167,6 @@ const util = require('util');
util.log('Timestamped message.');
```
### util.print([...strings])
<!-- YAML
added: v0.3.0
deprecated: v0.11.3
-->
> Stability: 0 - Deprecated: Use [`console.log()`][] instead.
Deprecated predecessor of `console.log`.
### util.puts([...strings])
<!-- YAML
added: v0.3.0

View File

@ -326,12 +326,6 @@ function _extend(target, source) {
// Deprecated old stuff.
function print(...args) {
for (var i = 0, len = args.length; i < len; ++i) {
process.stdout.write(String(args[i]));
}
}
function puts(...args) {
for (var i = 0, len = args.length; i < len; ++i) {
process.stdout.write(`${args[i]}\n`);
@ -447,9 +441,6 @@ module.exports = exports = {
error: deprecate(error,
'util.error is deprecated. Use console.error instead.',
'DEP0029'),
print: deprecate(print,
'util.print is deprecated. Use console.log instead.',
'DEP0026'),
puts: deprecate(puts,
'util.puts is deprecated. Use console.log instead.',
'DEP0027')

View File

@ -20,6 +20,6 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
(function() {
require('util').print('Loaded successfully!');
process.stdout.write('Loaded successfully!');
})();

View File

@ -22,7 +22,7 @@
(function() {
const fs = require('fs');
if (fs.readFile) {
require('util').print('fs loaded successfully');
process.stdout.write('fs loaded successfully');
}
})();

View File

@ -145,13 +145,11 @@ assert.strictEqual(util.isFunction(), false);
assert.strictEqual(util.isFunction('string'), false);
common.expectWarning('DeprecationWarning', [
['util.print is deprecated. Use console.log instead.', 'DEP0026'],
['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.print('test');
util.puts('test');
util.debug('test');
util.error('test');