From 4b08c4c0470797d180461f356a5c55a18e4e258c Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 3 Apr 2023 13:47:28 -0400 Subject: [PATCH] lib: runtime deprecate punycode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/47202 Reviewed-By: James M Snell Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Darshan Sen Reviewed-By: Matteo Collina --- 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 acbadb5c3d1..73f21cd3de1 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 d99588c7aec..7dfe552a5c9 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 ee439cac2f4..b5f4b6c7201 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:*:*)