Skip to content

Commit 29d3d1e

Browse files
committed
lib: move DEP0029 to end of life
PR-URL: nodejs#25377 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent a665d13 commit 29d3d1e

File tree

4 files changed

+7
-36
lines changed

4 files changed

+7
-36
lines changed

doc/api/deprecations.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,9 @@ Type: End-of-Life
632632
### DEP0029: util.error()
633633
<!-- YAML
634634
changes:
635+
- version: REPLACEME
636+
pr-url: https://github.com/nodejs/node/pull/xxxxx
637+
description: End-of-Life.
635638
- version:
636639
- v4.8.6
637640
- v6.12.0
@@ -642,10 +645,9 @@ changes:
642645
description: Runtime deprecation.
643646
-->
644647

645-
Type: Runtime
648+
Type: End-of-Life
646649

647-
The [`util.error()`][] API is deprecated. Please use [`console.error()`][]
648-
instead.
650+
`util.error()` has been removed. Please use [`console.error()`][] instead.
649651

650652
<a id="DEP0030"></a>
651653
### DEP0030: SlowBuffer
@@ -2397,7 +2399,6 @@ Setting the TLS ServerName to an IP address is not permitted by
23972399
[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
23982400
[`url.resolve()`]: url.html#url_url_resolve_from_to
23992401
[`util._extend()`]: util.html#util_util_extend_target_source
2400-
[`util.error()`]: util.html#util_util_error_strings
24012402
[`util.getSystemErrorName()`]: util.html#util_util_getsystemerrorname_err
24022403
[`util.inspect()`]: util.html#util_util_inspect_object_options
24032404
[`util.inspect.custom`]: util.html#util_util_inspect_custom

doc/api/util.md

-12
Original file line numberDiff line numberDiff line change
@@ -1714,18 +1714,6 @@ Node.js modules. The community found and used it anyway.
17141714
It is deprecated and should not be used in new code. JavaScript comes with very
17151715
similar built-in functionality through [`Object.assign()`].
17161716

1717-
### util.error([...strings])
1718-
<!-- YAML
1719-
added: v0.3.0
1720-
deprecated: v0.11.3
1721-
-->
1722-
1723-
> Stability: 0 - Deprecated: Use [`console.error()`][] instead.
1724-
1725-
* `...strings` {string} The message to print to `stderr`
1726-
1727-
Deprecated predecessor of `console.error`.
1728-
17291717
### util.isArray(object)
17301718
<!-- YAML
17311719
added: v0.6.0

lib/util.js

+1-13
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,6 @@ function _extend(target, source) {
324324
return target;
325325
}
326326

327-
// Deprecated old stuff.
328-
function error(...args) {
329-
for (var i = 0, len = args.length; i < len; ++i) {
330-
process.stderr.write(`${args[i]}\n`);
331-
}
332-
}
333-
334327
function callbackifyOnRejected(reason, cb) {
335328
// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
336329
// Because `null` is a special error value in callbacks which means "no error
@@ -421,10 +414,5 @@ module.exports = exports = {
421414
promisify,
422415
TextDecoder,
423416
TextEncoder,
424-
types,
425-
426-
// Deprecated Old Stuff
427-
error: deprecate(error,
428-
'util.error is deprecated. Use console.error instead.',
429-
'DEP0029')
417+
types
430418
};

test/parallel/test-util.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
'use strict';
2323
// Flags: --expose-internals
24-
const common = require('../common');
24+
require('../common');
2525
const assert = require('assert');
2626
const util = require('util');
2727
const errors = require('internal/errors');
@@ -144,12 +144,6 @@ assert.strictEqual(util.isFunction(function() {}), true);
144144
assert.strictEqual(util.isFunction(), false);
145145
assert.strictEqual(util.isFunction('string'), false);
146146

147-
common.expectWarning('DeprecationWarning', [
148-
['util.error is deprecated. Use console.error instead.', 'DEP0029']
149-
]);
150-
151-
util.error('test');
152-
153147
{
154148
assert.strictEqual(util.types.isNativeError(new Error()), true);
155149
assert.strictEqual(util.types.isNativeError(new TypeError()), true);

0 commit comments

Comments
 (0)