Skip to content

Commit

Permalink
child_process: reduce internal usage of public require of util
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
toshi1127 authored and targos committed Mar 30, 2019
1 parent 21486e5 commit 4defe47
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/child_process.js
Expand Up @@ -21,12 +21,14 @@

'use strict';

const util = require('util');
const {
deprecate, convertToValidSignal, getSystemErrorName
deprecate,
promisify,
convertToValidSignal,
getSystemErrorName
} = require('internal/util');
const { isArrayBufferView } = require('internal/util/types');
const debug = util.debuglog('child_process');
const debug = require('internal/util/debuglog').debuglog('child_process');
const { Buffer } = require('buffer');
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
const {
Expand Down Expand Up @@ -170,7 +172,7 @@ const customPromiseExecFunction = (orig) => {
};
};

Object.defineProperty(exports.exec, util.promisify.custom, {
Object.defineProperty(exports.exec, promisify.custom, {
enumerable: false,
value: customPromiseExecFunction(exports.exec)
});
Expand Down Expand Up @@ -391,7 +393,7 @@ exports.execFile = function execFile(file /* , args, options, callback */) {
return child;
};

Object.defineProperty(exports.execFile, util.promisify.custom, {
Object.defineProperty(exports.execFile, promisify.custom, {
enumerable: false,
value: customPromiseExecFunction(exports.execFile)
});
Expand Down

0 comments on commit 4defe47

Please sign in to comment.