Skip to content

Commit

Permalink
module: deprecate Module._debug
Browse files Browse the repository at this point in the history
The _debug of Module is undocumented and it useless here.

PR-URL: nodejs/node#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]>
  • Loading branch information
JacksonTian authored and addaleax committed Sep 23, 2017
1 parent 47d1691 commit 87411d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,15 @@ difference is that `querystring.parse()` does url encoding:
{ '%E5%A5%BD': '1' }
```
<a id="DEP0077"></a>
### DEP0077: Module.\_debug()
Type: Runtime
`Module._debug()` has been deprecated.
*Note*: `Module._debug()` was never documented as an officially supported API.
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
[`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer
Expand Down
6 changes: 3 additions & 3 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ Module.globalPaths = [];

Module.wrapper = NativeModule.wrapper;
Module.wrap = NativeModule.wrap;
Module._debug = util.debuglog('module');

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

Module._debug = util.deprecate(debug, 'Module._debug is deprecated.',
'DEP0077');

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

0 comments on commit 87411d9

Please sign in to comment.