Skip to content

Commit 382e859

Browse files
toshi1127ZYSzys
authored andcommitted
child_process: reduce internal usage of public require of util
PR-URL: #26769 Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent db40b4a commit 382e859

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/child_process.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121

2222
'use strict';
2323

24-
const util = require('util');
25-
const { convertToValidSignal, getSystemErrorName } = require('internal/util');
24+
const {
25+
promisify,
26+
convertToValidSignal,
27+
getSystemErrorName
28+
} = require('internal/util');
2629
const { isArrayBufferView } = require('internal/util/types');
27-
const debug = util.debuglog('child_process');
30+
const debug = require('internal/util/debuglog').debuglog('child_process');
2831
const { Buffer } = require('buffer');
2932
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
3033
const {
@@ -168,7 +171,7 @@ const customPromiseExecFunction = (orig) => {
168171
};
169172
};
170173

171-
Object.defineProperty(exports.exec, util.promisify.custom, {
174+
Object.defineProperty(exports.exec, promisify.custom, {
172175
enumerable: false,
173176
value: customPromiseExecFunction(exports.exec)
174177
});
@@ -389,7 +392,7 @@ exports.execFile = function execFile(file /* , args, options, callback */) {
389392
return child;
390393
};
391394

392-
Object.defineProperty(exports.execFile, util.promisify.custom, {
395+
Object.defineProperty(exports.execFile, promisify.custom, {
393396
enumerable: false,
394397
value: customPromiseExecFunction(exports.execFile)
395398
});

0 commit comments

Comments
 (0)