From 94f666da6c6ef2b20ac26eebb2fc69cb981edf96 Mon Sep 17 00:00:00 2001 From: toshi1127 Date: Tue, 19 Mar 2019 17:56:07 +0900 Subject: [PATCH] child_process: reduce internal usage of public require of util --- lib/child_process.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index 8060412b3f076f..1d7e7f1d0935fc 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -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 { @@ -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) }); @@ -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) });