From a381a7f896c151f8f08f16a84f86064d26bceaff Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Wed, 28 Jun 2017 01:20:12 +0800 Subject: [PATCH] module: deprecate Module._debug The _debug of Module is undocumented and it useless here. --- doc/api/deprecations.md | 9 +++++++++ lib/module.js | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 01fce09759c67f..259a341818735a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -683,6 +683,15 @@ difference is that `querystring.parse()` does url encoding: { '%E5%A5%BD': '1' } ``` + +### DEP00XX: 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 diff --git a/lib/module.js b/lib/module.js index 0b87cf7480e4d9..c3d87f36c99bde 100644 --- a/lib/module.js +++ b/lib/module.js @@ -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.', + 'DEP00XX'); // given a module name, and a list of paths to test, returns the first // matching file in the following precedence.