Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: do not mark experimental feature as deprecated #55740

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3761,18 +3761,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
Expand Down Expand Up @@ -3899,7 +3888,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
Expand Down
4 changes: 4 additions & 0 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@

<!-- YAML
added: v22.9.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55626

Check warning on line 375 in doc/api/util.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: The API is renamed from `util.getCallSite` to `util.getCallSites()`.
-->

* `frameCount` {number} Optional number of frames to capture as call site objects.
Expand Down
4 changes: 3 additions & 1 deletion lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,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 :
Expand Down
4 changes: 2 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-util-getcallsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Loading