Skip to content

Commit 6a2dccf

Browse files
aduh95tpoisseau
authored andcommitted
util: do not mark experimental feature as deprecated
PR-URL: nodejs#55740 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
1 parent 20c55e1 commit 6a2dccf

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

doc/api/deprecations.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -3764,18 +3764,7 @@ Instantiating classes without the `new` qualifier exported by the `node:repl` mo
37643764
It is recommended to use the `new` qualifier instead. This applies to all REPL classes, including
37653765
`REPLServer` and `Recoverable`.
37663766

3767-
### DEP0186: `util.getCallSite`
3768-
3769-
<!-- YAML
3770-
changes:
3771-
- version: REPLACEME
3772-
pr-url: https://github.com/nodejs/node/pull/55626
3773-
description: Runtime deprecation.
3774-
-->
3775-
3776-
Type: Runtime
3777-
3778-
The `util.getCallSite` API has been removed. Please use [`util.getCallSites()`][] instead.
3767+
<!-- md-lint skip-deprecation DEP0186 -->
37793768

37803769
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
37813770
[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()`][
39023891
[`url.parse()`]: url.md#urlparseurlstring-parsequerystring-slashesdenotehost
39033892
[`url.resolve()`]: url.md#urlresolvefrom-to
39043893
[`util._extend()`]: util.md#util_extendtarget-source
3905-
[`util.getCallSites()`]: util.md#utilgetcallsitesframecountoroptions-options
39063894
[`util.getSystemErrorName()`]: util.md#utilgetsystemerrornameerr
39073895
[`util.inspect()`]: util.md#utilinspectobject-options
39083896
[`util.inspect.custom`]: util.md#utilinspectcustom

doc/api/util.md

+4
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
370370
371371
<!-- YAML
372372
added: v22.9.0
373+
changes:
374+
- version: REPLACEME
375+
pr-url: https://github.com/nodejs/node/pull/55626
376+
description: The API is renamed from `util.getCallSite` to `util.getCallSites()`.
373377
-->
374378

375379
* `frameCount` {number} Optional number of frames to capture as call site objects.

lib/internal/util.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ function getDeprecationWarningEmitter(
108108
return function() {
109109
if (!warned && shouldEmitWarning()) {
110110
warned = true;
111-
if (code !== undefined) {
111+
if (code === 'ExperimentalWarning') {
112+
process.emitWarning(msg, code, deprecated);
113+
} else if (code !== undefined) {
112114
if (!codesWarned.has(code)) {
113115
const emitWarning = useEmitSync ?
114116
require('internal/process/warning').emitWarningSync :

lib/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ module.exports = {
436436
// Deprecated getCallSite.
437437
// This API can be removed in next semver-minor release.
438438
getCallSite: deprecate(getCallSites,
439-
'The `util.getCallSite` API is deprecated. Please use `util.getCallSites()` instead.',
440-
'DEP0186'),
439+
'The `util.getCallSite` API has been renamed to `util.getCallSites()`.',
440+
'ExperimentalWarning'),
441441
getCallSites,
442442
getSystemErrorMap,
443443
getSystemErrorName,

test/parallel/test-util-getcallsite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ require('../common');
44
const { getCallSite } = require('node:util');
55
const { expectWarning } = require('../common');
66

7-
const warning = 'The `util.getCallSite` API is deprecated. Please use `util.getCallSites()` instead.';
8-
expectWarning('DeprecationWarning', warning, 'DEP0186');
7+
const warning = 'The `util.getCallSite` API has been renamed to `util.getCallSites()`.';
8+
expectWarning('ExperimentalWarning', warning);
99
getCallSite();

0 commit comments

Comments
 (0)