File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -831,12 +831,15 @@ The [`require.extensions`][] property is deprecated.
831831### DEP0040: `punycode` module
832832<!-- YAML
833833changes:
834+ - version: REPLACEME
835+ pr-url: https://github.com/nodejs/node/pull/38444
836+ description: Added support for `--pending-deprecation`.
834837 - version: v7.0.0
835838 pr-url: https://github.com/nodejs/node/pull/7941
836839 description: Documentation-only deprecation.
837840-->
838841
839- Type: Documentation-only
842+ Type: Documentation-only (supports [`--pending-deprecation`][])
840843
841844The [`punycode`][] module is deprecated. Please use a userland alternative
842845instead.
Original file line number Diff line number Diff line change 11'use strict';
22
3+ const { getOptionValue } = require('internal/options');
4+ if (getOptionValue('--pending-deprecation')){
5+ process.emitWarning(
6+ 'The `punycode` module is deprecated. Please use a userland ' +
7+ 'alternative instead.',
8+ 'DeprecationWarning',
9+ 'DEP0040',
10+ );
11+ }
12+
313/** Highest positive signed 32-bit float value */
414const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
515
Original file line number Diff line number Diff line change 1- node:punycode:42
1+ node:punycode:52
22 throw new RangeError(errors[type]);
33 ^
44
55RangeError: Invalid input
6- at error (node:punycode:42 :8)
6+ at error (node:punycode:52 :8)
77 at Object.decode (node:punycode:*:*)
88 at Object.<anonymous> (*test*message*core_line_numbers.js:*:*)
99 at Module._compile (node:internal/modules/cjs/loader:*:*)
Original file line number Diff line number Diff line change 1+ // Flags: --pending-deprecation
2+
13// Copyright Joyent, Inc. and other Node contributors.
24//
35// Permission is hereby granted, free of charge, to any person obtaining a
2022// USE OR OTHER DEALINGS IN THE SOFTWARE.
2123
2224'use strict';
23- require('../common');
25+ const common = require('../common');
26+
27+ const punycodeWarning =
28+ 'The `punycode` module is deprecated. Please use a userland alternative ' +
29+ 'instead.';
30+ common.expectWarning('DeprecationWarning', punycodeWarning, 'DEP0040');
31+
2432const punycode = require('punycode');
2533const assert = require('assert');
2634
You can’t perform that action at this time.
0 commit comments