0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 13:09:21 +01:00

util: do not mark experimental feature as deprecated

PR-URL: https://github.com/nodejs/node/pull/55740
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
Antoine du Hamel 2024-11-08 16:16:15 +00:00 committed by GitHub
parent e0ef622c54
commit 94be10ac32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 18 deletions

View File

@ -3764,18 +3764,7 @@ Instantiating classes without the `new` qualifier exported by the `node:repl` mo
It is recommended to use the `new` qualifier instead. This applies to all REPL classes, including
`REPLServer` and `Recoverable`.
### DEP0186: `util.getCallSite`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55626
description: Runtime deprecation.
-->
Type: Runtime
The `util.getCallSite` API has been removed. Please use [`util.getCallSites()`][] instead.
<!-- md-lint skip-deprecation DEP0186 -->
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@ -3902,7 +3891,6 @@ The `util.getCallSite` API has been removed. Please use [`util.getCallSites()`][
[`url.parse()`]: url.md#urlparseurlstring-parsequerystring-slashesdenotehost
[`url.resolve()`]: url.md#urlresolvefrom-to
[`util._extend()`]: util.md#util_extendtarget-source
[`util.getCallSites()`]: util.md#utilgetcallsitesframecountoroptions-options
[`util.getSystemErrorName()`]: util.md#utilgetsystemerrornameerr
[`util.inspect()`]: util.md#utilinspectobject-options
[`util.inspect.custom`]: util.md#utilinspectcustom

View File

@ -370,6 +370,10 @@ util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
<!-- YAML
added: v22.9.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55626
description: The API is renamed from `util.getCallSite` to `util.getCallSites()`.
-->
* `frameCount` {number} Optional number of frames to capture as call site objects.

View File

@ -108,7 +108,9 @@ function getDeprecationWarningEmitter(
return function() {
if (!warned && shouldEmitWarning()) {
warned = true;
if (code !== undefined) {
if (code === 'ExperimentalWarning') {
process.emitWarning(msg, code, deprecated);
} else if (code !== undefined) {
if (!codesWarned.has(code)) {
const emitWarning = useEmitSync ?
require('internal/process/warning').emitWarningSync :

View File

@ -436,8 +436,8 @@ module.exports = {
// Deprecated getCallSite.
// This API can be removed in next semver-minor release.
getCallSite: deprecate(getCallSites,
'The `util.getCallSite` API is deprecated. Please use `util.getCallSites()` instead.',
'DEP0186'),
'The `util.getCallSite` API has been renamed to `util.getCallSites()`.',
'ExperimentalWarning'),
getCallSites,
getSystemErrorMap,
getSystemErrorName,

View File

@ -4,6 +4,6 @@ require('../common');
const { getCallSite } = require('node:util');
const { expectWarning } = require('../common');
const warning = 'The `util.getCallSite` API is deprecated. Please use `util.getCallSites()` instead.';
expectWarning('DeprecationWarning', warning, 'DEP0186');
const warning = 'The `util.getCallSite` API has been renamed to `util.getCallSites()`.';
expectWarning('ExperimentalWarning', warning);
getCallSite();