From 88c969b4813ca9c650b58a90e638306ea446a68e Mon Sep 17 00:00:00 2001 From: dnlup Date: Thu, 21 Mar 2019 16:45:59 +0100 Subject: [PATCH] module: remove usage of require('util') in `cjs/loader.js` Use `require('internal/util').deprecate` instead of `require('util').deprecate` in `lib/internal/modules/cjs/loader.js`. Refs: https://github.com/nodejs/node/issues/26546 --- lib/internal/modules/cjs/loader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index ee1c814c814bd5..26f3d77f64071e 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -23,7 +23,7 @@ const { NativeModule } = require('internal/bootstrap/loaders'); const { pathToFileURL } = require('internal/url'); -const util = require('util'); +const { deprecate } = require('internal/util'); const vm = require('vm'); const assert = require('internal/assert'); const fs = require('fs'); @@ -182,8 +182,8 @@ function debug(...args) { debuglog(...args); } -Module._debug = util.deprecate(debug, 'Module._debug is deprecated.', - 'DEP0077'); +Module._debug = 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.