lib: runtime deprecate punycode

PR-URL: https://github.com/nodejs/node/pull/47202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
Yagiz Nizipli 2023-04-03 13:47:28 -04:00 committed by GitHub
parent 74b9cf2ee1
commit 4b08c4c047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View File

@ -872,6 +872,9 @@ The [`require.extensions`][] property is deprecated.
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/47202
description: Runtime deprecation.
- version: v16.6.0
pr-url: https://github.com/nodejs/node/pull/38444
description: Added support for `--pending-deprecation`.
@ -880,7 +883,7 @@ changes:
description: Documentation-only deprecation.
-->
Type: Documentation-only (supports [`--pending-deprecation`][])
Type: Runtime
The [`punycode`][] module is deprecated. Please use a userland alternative
instead.

View File

@ -1,14 +1,11 @@
'use strict';
const { getOptionValue } = require('internal/options');
if (getOptionValue('--pending-deprecation')){
process.emitWarning(
process.emitWarning(
'The `punycode` module is deprecated. Please use a userland ' +
'alternative instead.',
'DeprecationWarning',
'DEP0040',
);
}
);
/** Highest positive signed 32-bit float value */
const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1

View File

@ -1,9 +1,9 @@
node:punycode:52
node:punycode:49
throw new RangeError(errors[type]);
^
RangeError: Invalid input
at error (node:punycode:52:8)
at error (node:punycode:49:8)
at Object.decode (node:punycode:*:*)
at Object.<anonymous> (*test*message*core_line_numbers.js:*:*)