From d31feb8c6f7c883b28db7e5a9e4bf8be9d49b23b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 8 Sep 2020 00:10:44 +0200 Subject: [PATCH] punycode: add pending deprecation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/38444 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat --- lib/punycode.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/punycode.js b/lib/punycode.js index da54942f1a80a9..4d8652fc290223 100644 --- a/lib/punycode.js +++ b/lib/punycode.js @@ -1,5 +1,15 @@ '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', + ); +} + /** Highest positive signed 32-bit float value */ const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1