From b867294aa0749bf388caa5928abdd9bb45c94114 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 20 Oct 2016 12:34:09 -0400 Subject: [PATCH] child_process: remove unreachable execSync() code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code coverage showed that the execSync() variable inheritStderr was never set to the default value of true. This is because the default case is hit whenever normalizeExecArgs() returns an object without an 'options' property. However, this can never be the case because normalizeExecArgs() unconditionally creates the options object. This commit removes the unreachable code. PR-URL: https://github.com/nodejs/node/pull/9209 Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani --- lib/child_process.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/child_process.js b/lib/child_process.js index 5a0fd6e21e..69afdbe68d 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -512,7 +512,7 @@ exports.execFileSync = execFileSync; function execSync(command /*, options*/) { var opts = normalizeExecArgs.apply(null, arguments); - var inheritStderr = opts.options ? !opts.options.stdio : true; + var inheritStderr = !opts.options.stdio; var ret = spawnSync(opts.file, opts.options); ret.cmd = command;