Skip to content

Commit 4defe47

Browse files
toshi1127targos
authored andcommittedMar 30, 2019
child_process: reduce internal usage of public require of util
PR-URL: #26769 Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 21486e5 commit 4defe47

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎lib/child_process.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121

2222
'use strict';
2323

24-
const util = require('util');
2524
const {
26-
deprecate, convertToValidSignal, getSystemErrorName
25+
deprecate,
26+
promisify,
27+
convertToValidSignal,
28+
getSystemErrorName
2729
} = require('internal/util');
2830
const { isArrayBufferView } = require('internal/util/types');
29-
const debug = util.debuglog('child_process');
31+
const debug = require('internal/util/debuglog').debuglog('child_process');
3032
const { Buffer } = require('buffer');
3133
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
3234
const {
@@ -170,7 +172,7 @@ const customPromiseExecFunction = (orig) => {
170172
};
171173
};
172174

173-
Object.defineProperty(exports.exec, util.promisify.custom, {
175+
Object.defineProperty(exports.exec, promisify.custom, {
174176
enumerable: false,
175177
value: customPromiseExecFunction(exports.exec)
176178
});
@@ -391,7 +393,7 @@ exports.execFile = function execFile(file /* , args, options, callback */) {
391393
return child;
392394
};
393395

394-
Object.defineProperty(exports.execFile, util.promisify.custom, {
396+
Object.defineProperty(exports.execFile, promisify.custom, {
395397
enumerable: false,
396398
value: customPromiseExecFunction(exports.execFile)
397399
});

0 commit comments

Comments
 (0)
Please sign in to comment.