File tree 4 files changed +36
-6
lines changed
4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -3849,6 +3849,22 @@ Type: Documentation-only
3849
3849
` process.features.tls_alpn ` , ` process.features.tls_ocsp ` , and ` process.features.tls_sni ` are
3850
3850
deprecated, as their values are guaranteed to be identical to that of ` process.features.tls ` .
3851
3851
3852
+ ### DEP0190: ` repl.builtinModules `
3853
+
3854
+ <!-- YAML
3855
+ changes:
3856
+ - version: REPLACEME
3857
+ pr-url: https://github.com/nodejs/node/pull/57508
3858
+ description: Documentation-only (supports [`--pending-deprecation`][]).
3859
+ -->
3860
+
3861
+ Type: Documentation-only
3862
+
3863
+ The ` node:repl ` module exports a ` builtinModules ` property that contains an array
3864
+ of built-in modules. This was incomplete and matched the already deprecated
3865
+ ` repl._builtinLibs ` (DEP0142) instead it's better to rely
3866
+ upon ` require('node:module').builtinModules ` .
3867
+
3852
3868
[ NIST SP 800-38D ] : https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
3853
3869
[ RFC 6066 ] : https://tools.ietf.org/html/rfc6066#section-3
3854
3870
[ RFC 8247 Section 2.4 ] : https://www.rfc-editor.org/rfc/rfc8247#section-2.4
Original file line number Diff line number Diff line change @@ -646,8 +646,11 @@ with REPL instances programmatically.
646
646
647
647
<!-- YAML
648
648
added: v14.5.0
649
+ deprecated: REPLACEME
649
650
-->
650
651
652
+ > Stability: 0 - Deprecated. Use ` module.builtinModules ` instead.
653
+
651
654
* {string\[ ] }
652
655
653
656
A list of the names of all Node.js modules, e.g., ` 'http' ` .
Original file line number Diff line number Diff line change @@ -1862,9 +1862,17 @@ module.exports = {
1862
1862
1863
1863
ObjectDefineProperty ( module . exports , 'builtinModules' , {
1864
1864
__proto__ : null ,
1865
- get : ( ) => _builtinLibs ,
1866
- set : ( val ) => _builtinLibs = val ,
1867
- enumerable : true ,
1865
+ get : pendingDeprecation ? deprecate (
1866
+ ( ) => require ( '' ) ,
1867
+ 'repl.builtinModules is deprecated. Check module.builtinModules instead' ,
1868
+ 'DEP0190' ,
1869
+ ) : ( ) => _builtinLibs ,
1870
+ set : pendingDeprecation ? deprecate (
1871
+ ( val ) => _builtinLibs = val ,
1872
+ 'repl.builtinModules is deprecated. Check module.builtinModules instead' ,
1873
+ 'DEP0190' ,
1874
+ ) : ( val ) => _builtinLibs = val ,
1875
+ enumerable : false ,
1868
1876
configurable : true ,
1869
1877
} ) ;
1870
1878
Original file line number Diff line number Diff line change @@ -29,14 +29,17 @@ const repl = require('repl');
29
29
const cp = require ( 'child_process' ) ;
30
30
31
31
assert . strictEqual ( repl . repl , undefined ) ;
32
+
32
33
repl . _builtinLibs ; // eslint-disable-line no-unused-expressions
34
+ repl . builtinModules ; // eslint-disable-line no-unused-expressions
33
35
34
36
common . expectWarning ( {
35
37
DeprecationWarning : {
36
38
DEP0142 :
37
39
'repl._builtinLibs is deprecated. Check module.builtinModules instead' ,
40
+ DEP0190 : 'repl.builtinModules is deprecated. Check module.builtinModules instead' ,
38
41
DEP0141 : 'repl.inputStream and repl.outputStream are deprecated. ' +
39
- 'Use repl.input and repl.output instead' ,
42
+ 'Use repl.input and repl.output instead' ,
40
43
}
41
44
} ) ;
42
45
@@ -62,9 +65,9 @@ assert.strictEqual(r1.replMode, repl.REPL_MODE_SLOPPY);
62
65
assert . strictEqual ( r1 . historySize , 30 ) ;
63
66
64
67
// 2
65
- function writer ( ) { }
68
+ function writer ( ) { }
66
69
67
- function evaler ( ) { }
70
+ function evaler ( ) { }
68
71
const r2 = repl . start ( {
69
72
input : stream ,
70
73
output : stream ,
You can’t perform that action at this time.
0 commit comments