summaryrefslogtreecommitdiff
path: root/lib/child_process.js
diff options
context:
space:
mode:
authorWeijia Wang <381152119@qq.com>2017-10-07 22:50:42 +0800
committerTobias Nießen <tniessen@tnie.de>2017-10-16 23:34:32 +0200
commit212de3c5ec429a580d2e79ce3c2516b93b52b8f5 (patch)
treed74522686a9753df084b42bcaf766a3a8ad97e7d /lib/child_process.js
parenta3a106865a95665a3f2d8d7c03a1a12f1680a087 (diff)
downloadnode-new-212de3c5ec429a580d2e79ce3c2516b93b52b8f5.tar.gz
lib: use destructuring for some constants
This change is to unify the declaration for constants into using destructuring on the top-level-module scope, reducing some redundant code. PR-URL: https://github.com/nodejs/node/pull/16063 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'lib/child_process.js')
-rw-r--r--lib/child_process.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/child_process.js b/lib/child_process.js
index fc538343f1..3bf3b23a1c 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -27,15 +27,17 @@ const { isUint8Array } = require('internal/util/types');
const { createPromise,
promiseResolve, promiseReject } = process.binding('util');
const debug = util.debuglog('child_process');
-
-const Buffer = require('buffer').Buffer;
-const Pipe = process.binding('pipe_wrap').Pipe;
+const { Buffer } = require('buffer');
+const { Pipe } = process.binding('pipe_wrap');
const { errname } = process.binding('uv');
const child_process = require('internal/child_process');
+const {
+ _validateStdio,
+ setupChannel,
+ ChildProcess
+} = child_process;
-const _validateStdio = child_process._validateStdio;
-const setupChannel = child_process.setupChannel;
-const ChildProcess = exports.ChildProcess = child_process.ChildProcess;
+exports.ChildProcess = ChildProcess;
function stdioStringToArray(option) {
switch (option) {