File tree 4 files changed +25
-4
lines changed
4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -831,12 +831,15 @@ The [`require.extensions`][] property is deprecated.
831
831
### DEP0040: ` punycode ` module
832
832
<!-- YAML
833
833
changes:
834
+ - version: REPLACEME
835
+ pr-url: https://github.com/nodejs/node/pull/38444
836
+ description: Added support for `--pending-deprecation`.
834
837
- version: v7.0.0
835
838
pr-url: https://github.com/nodejs/node/pull/7941
836
839
description: Documentation-only deprecation.
837
840
-->
838
841
839
- Type: Documentation-only
842
+ Type: Documentation-only (supports [ ` --pending-deprecation ` ] [ ] )
840
843
841
844
The [ ` punycode ` ] [ ] module is deprecated. Please use a userland alternative
842
845
instead.
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
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
+
3
13
/** Highest positive signed 32-bit float value */
4
14
const maxInt = 2147483647 ; // aka. 0x7FFFFFFF or 2^31-1
5
15
Original file line number Diff line number Diff line change 1
- node:punycode:42
1
+ node:punycode:52
2
2
throw new RangeError(errors[type]);
3
3
^
4
4
5
5
RangeError: Invalid input
6
- at error (node:punycode:42 :8)
6
+ at error (node:punycode:52 :8)
7
7
at Object.decode (node:punycode:*:*)
8
8
at Object.<anonymous> (*test*message*core_line_numbers.js:*:*)
9
9
at Module._compile (node:internal/modules/cjs/loader:*:*)
Original file line number Diff line number Diff line change
1
+ // Flags: --pending-deprecation
2
+
1
3
// Copyright Joyent, Inc. and other Node contributors.
2
4
//
3
5
// Permission is hereby granted, free of charge, to any person obtaining a
20
22
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
23
22
24
'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
+
24
32
const punycode = require ( 'punycode' ) ;
25
33
const assert = require ( 'assert' ) ;
26
34
You can’t perform that action at this time.
0 commit comments