From 9a020b6589c03f9c7845fcfe118ff2530c0a6775 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 21 Mar 2023 15:26:12 -0400 Subject: [PATCH] lib: runtime deprecate punycode --- doc/api/deprecations.md | 5 ++++- lib/punycode.js | 15 ++++++--------- test/message/core_line_numbers.out | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index acb9197f95d9c4..5cf7342f46a93e 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -872,6 +872,9 @@ The [`require.extensions`][] property is deprecated. -Type: Documentation-only (supports [`--pending-deprecation`][]) +Type: Runtime The [`punycode`][] module is deprecated. Please use a userland alternative instead. diff --git a/lib/punycode.js b/lib/punycode.js index d99588c7aec8f4..7dfe552a5c9efa 100644 --- a/lib/punycode.js +++ b/lib/punycode.js @@ -1,14 +1,11 @@ 'use strict'; -const { getOptionValue } = require('internal/options'); -if (getOptionValue('--pending-deprecation')){ - process.emitWarning( - 'The `punycode` module is deprecated. Please use a userland ' + - 'alternative instead.', - 'DeprecationWarning', - 'DEP0040', - ); -} +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 diff --git a/test/message/core_line_numbers.out b/test/message/core_line_numbers.out index ee439cac2f4354..b5f4b6c72010e9 100644 --- a/test/message/core_line_numbers.out +++ b/test/message/core_line_numbers.out @@ -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. (*test*message*core_line_numbers.js:*:*)