lib: move DEP0029 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
a665d13ad9
commit
29d3d1ea13
@ -632,6 +632,9 @@ Type: End-of-Life
|
|||||||
### DEP0029: util.error()
|
### DEP0029: util.error()
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/xxxxx
|
||||||
|
description: End-of-Life.
|
||||||
- version:
|
- version:
|
||||||
- v4.8.6
|
- v4.8.6
|
||||||
- v6.12.0
|
- v6.12.0
|
||||||
@ -642,10 +645,9 @@ changes:
|
|||||||
description: Runtime deprecation.
|
description: Runtime deprecation.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
Type: Runtime
|
Type: End-of-Life
|
||||||
|
|
||||||
The [`util.error()`][] API is deprecated. Please use [`console.error()`][]
|
`util.error()` has been removed. Please use [`console.error()`][] instead.
|
||||||
instead.
|
|
||||||
|
|
||||||
<a id="DEP0030"></a>
|
<a id="DEP0030"></a>
|
||||||
### DEP0030: SlowBuffer
|
### DEP0030: SlowBuffer
|
||||||
@ -2397,7 +2399,6 @@ Setting the TLS ServerName to an IP address is not permitted by
|
|||||||
[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
|
[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
|
||||||
[`url.resolve()`]: url.html#url_url_resolve_from_to
|
[`url.resolve()`]: url.html#url_url_resolve_from_to
|
||||||
[`util._extend()`]: util.html#util_util_extend_target_source
|
[`util._extend()`]: util.html#util_util_extend_target_source
|
||||||
[`util.error()`]: util.html#util_util_error_strings
|
|
||||||
[`util.getSystemErrorName()`]: util.html#util_util_getsystemerrorname_err
|
[`util.getSystemErrorName()`]: util.html#util_util_getsystemerrorname_err
|
||||||
[`util.inspect()`]: util.html#util_util_inspect_object_options
|
[`util.inspect()`]: util.html#util_util_inspect_object_options
|
||||||
[`util.inspect.custom`]: util.html#util_util_inspect_custom
|
[`util.inspect.custom`]: util.html#util_util_inspect_custom
|
||||||
|
@ -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
|
It is deprecated and should not be used in new code. JavaScript comes with very
|
||||||
similar built-in functionality through [`Object.assign()`].
|
similar built-in functionality through [`Object.assign()`].
|
||||||
|
|
||||||
### util.error([...strings])
|
|
||||||
<!-- YAML
|
|
||||||
added: v0.3.0
|
|
||||||
deprecated: v0.11.3
|
|
||||||
-->
|
|
||||||
|
|
||||||
> Stability: 0 - Deprecated: Use [`console.error()`][] instead.
|
|
||||||
|
|
||||||
* `...strings` {string} The message to print to `stderr`
|
|
||||||
|
|
||||||
Deprecated predecessor of `console.error`.
|
|
||||||
|
|
||||||
### util.isArray(object)
|
### util.isArray(object)
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.6.0
|
added: v0.6.0
|
||||||
|
14
lib/util.js
14
lib/util.js
@ -324,13 +324,6 @@ function _extend(target, source) {
|
|||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated old stuff.
|
|
||||||
function error(...args) {
|
|
||||||
for (var i = 0, len = args.length; i < len; ++i) {
|
|
||||||
process.stderr.write(`${args[i]}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callbackifyOnRejected(reason, cb) {
|
function callbackifyOnRejected(reason, cb) {
|
||||||
// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
|
// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
|
||||||
// Because `null` is a special error value in callbacks which means "no error
|
// Because `null` is a special error value in callbacks which means "no error
|
||||||
@ -421,10 +414,5 @@ module.exports = exports = {
|
|||||||
promisify,
|
promisify,
|
||||||
TextDecoder,
|
TextDecoder,
|
||||||
TextEncoder,
|
TextEncoder,
|
||||||
types,
|
types
|
||||||
|
|
||||||
// Deprecated Old Stuff
|
|
||||||
error: deprecate(error,
|
|
||||||
'util.error is deprecated. Use console.error instead.',
|
|
||||||
'DEP0029')
|
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
// Flags: --expose-internals
|
// Flags: --expose-internals
|
||||||
const common = require('../common');
|
require('../common');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const errors = require('internal/errors');
|
const errors = require('internal/errors');
|
||||||
@ -144,12 +144,6 @@ assert.strictEqual(util.isFunction(function() {}), true);
|
|||||||
assert.strictEqual(util.isFunction(), false);
|
assert.strictEqual(util.isFunction(), false);
|
||||||
assert.strictEqual(util.isFunction('string'), false);
|
assert.strictEqual(util.isFunction('string'), false);
|
||||||
|
|
||||||
common.expectWarning('DeprecationWarning', [
|
|
||||||
['util.error is deprecated. Use console.error instead.', 'DEP0029']
|
|
||||||
]);
|
|
||||||
|
|
||||||
util.error('test');
|
|
||||||
|
|
||||||
{
|
{
|
||||||
assert.strictEqual(util.types.isNativeError(new Error()), true);
|
assert.strictEqual(util.types.isNativeError(new Error()), true);
|
||||||
assert.strictEqual(util.types.isNativeError(new TypeError()), true);
|
assert.strictEqual(util.types.isNativeError(new TypeError()), true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user