Skip to content

Commit 9d7574e

Browse files
JacksonTianBridgeAR
authored andcommitted
module: deprecate Module._debug
The _debug of Module is undocumented and it useless here. PR-URL: #13948 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 6f1caad commit 9d7574e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

doc/api/deprecations.md

+9
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,15 @@ difference is that `querystring.parse()` does url encoding:
684684
{ '%E5%A5%BD': '1' }
685685
```
686686
687+
<a id="DEP0077"></a>
688+
### DEP0077: Module.\_debug()
689+
690+
Type: Runtime
691+
692+
`Module._debug()` has been deprecated.
693+
694+
*Note*: `Module._debug()` was never documented as an officially supported API.
695+
687696
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
688697
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
689698
[`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer

lib/module.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ Module.globalPaths = [];
8080

8181
Module.wrapper = NativeModule.wrapper;
8282
Module.wrap = NativeModule.wrap;
83-
Module._debug = util.debuglog('module');
8483

85-
// We use this alias for the preprocessor that filters it out
86-
const debug = Module._debug;
84+
const debug = util.debuglog('module');
8785

86+
Module._debug = util.deprecate(debug, 'Module._debug is deprecated.',
87+
'DEP0077');
8888

8989
// given a module name, and a list of paths to test, returns the first
9090
// matching file in the following precedence.

0 commit comments

Comments
 (0)