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 ZYSzys committed Mar 22, 2019
1 parent db40b4a commit 382e859
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@

'use strict';

const util = require('util');
const { convertToValidSignal, getSystemErrorName } = require('internal/util');
const {
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 @@ -168,7 +171,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 @@ -389,7 +392,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 382e859

Please sign in to comment.