lib: move DEP0026 to end of life · nodejs/node@2d578ad (original) (raw)

6 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -569,6 +569,9 @@ The `sys` module is deprecated. Please use the [`util`][] module instead.
569 569 ### DEP0026: util.print()
570 570 <!-- YAML
571 571 changes:
572 + - version: REPLACEME
573 + pr-url: https://github.com/nodejs/node/pull/xxxxx
574 + description: End-of-Life.
572 575 - version:
573 576 - v4.8.6
574 577 - v6.12.0
@@ -579,10 +582,9 @@ changes:
579 582 description: Runtime deprecation.
580 583 -->
581 584
582 -Type: Runtime
585 +Type: End-of-Life
583 586
584 -The [`util.print()`][] API is deprecated. Please use [`console.log()`][]
585 -instead.
587 +`util.print()` has been removed. Please use [`console.log()`][] instead.
586 588
587 589 <a id="DEP0027"></a>
588 590 ### DEP0027: util.puts()
@@ -2411,7 +2413,6 @@ Setting the TLS ServerName to an IP address is not permitted by
2411 2413 [`util.isSymbol()`]: util.html#util_util_issymbol_object
2412 2414 [`util.isUndefined()`]: util.html#util_util_isundefined_object
2413 2415 [`util.log()`]: util.html#util_util_log_string
2414 -[`util.print()`]: util.html#util_util_print_strings
2415 2416 [`util.puts()`]: util.html#util_util_puts_strings
2416 2417 [`util.types`]: util.html#util_util_types
2417 2418 [`util`]: util.html
Original file line number Diff line number Diff line change
@@ -2167,16 +2167,6 @@ const util = require('util');
2167 2167 util.log('Timestamped message.');
2168 2168 ```
2169 2169
2170 -### util.print([...strings])
2171 -<!-- YAML
2172 -added: v0.3.0
2173 -deprecated: v0.11.3
2174 --->
2175 -
2176 -> Stability: 0 - Deprecated: Use [`console.log()`][] instead.
2177 -
2178 -Deprecated predecessor of `console.log`.
2179 -
2180 2170 ### util.puts([...strings])
2181 2171 <!-- YAML
2182 2172 added: v0.3.0
Original file line number Diff line number Diff line change
@@ -326,12 +326,6 @@ function _extend(target, source) {
326 326
327 327 // Deprecated old stuff.
328 328
329 -function print(...args) {
330 -for (var i = 0, len = args.length; i < len; ++i) {
331 -process.stdout.write(String(args[i]));
332 -}
333 -}
334 -
335 329 function puts(...args) {
336 330 for (var i = 0, len = args.length; i < len; ++i) {
337 331 process.stdout.write(`${args[i]}\n`);
@@ -447,9 +441,6 @@ module.exports = exports = {
447 441 error: deprecate(error,
448 442 'util.error is deprecated. Use console.error instead.',
449 443 'DEP0029'),
450 -print: deprecate(print,
451 -'util.print is deprecated. Use console.log instead.',
452 -'DEP0026'),
453 444 puts: deprecate(puts,
454 445 'util.puts is deprecated. Use console.log instead.',
455 446 'DEP0027')
Original file line number Diff line number Diff line change
@@ -20,6 +20,6 @@
20 20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 21
22 22 (function() {
23 -require('util').print('Loaded successfully!');
23 +process.stdout.write('Loaded successfully!');
24 24 })();
25 25
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
22 22 (function() {
23 23 const fs = require('fs');
24 24 if (fs.readFile) {
25 -require('util').print('fs loaded successfully');
25 +process.stdout.write('fs loaded successfully');
26 26 }
27 27 })();
28 28
Original file line number Diff line number Diff line change
@@ -145,13 +145,11 @@ assert.strictEqual(util.isFunction(), false);
145 145 assert.strictEqual(util.isFunction('string'), false);
146 146
147 147 common.expectWarning('DeprecationWarning', [
148 -['util.print is deprecated. Use console.log instead.', 'DEP0026'],
149 148 ['util.puts is deprecated. Use console.log instead.', 'DEP0027'],
150 149 ['util.debug is deprecated. Use console.error instead.', 'DEP0028'],
151 150 ['util.error is deprecated. Use console.error instead.', 'DEP0029']
152 151 ]);
153 152
154 -util.print('test');
155 153 util.puts('test');
156 154 util.debug('test');
157 155 util.error('test');