child_process: remove unreachable execSync() code

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 <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit is contained in:
cjihrig authored and Myles Borins committed 2016-11-18 19:03:55 -05:00
1 parent 0cffa3c87e
commit b867294aa0
1 file changed
+1 -1
+1 -1
View File
@@ -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;