punycode: add pending deprecation

PR-URL: https://github.com/nodejs/node/pull/38444
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
Antoine du Hamel 2020-09-08 00:10:44 +02:00 committed by James M Snell
parent 6434cd66bb
commit 40ea8aa364
No known key found for this signature in database
GPG key ID: 7341B15C070877AC
4 changed files with 25 additions and 4 deletions

View file

@ -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