Skip to content

Commit d573acf

Browse files
cjihrigevanlucas
authored andcommitted
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: #9209 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 63ef099 commit d573acf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/child_process.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ exports.execFileSync = execFileSync;
517517

518518
function execSync(command /*, options*/) {
519519
var opts = normalizeExecArgs.apply(null, arguments);
520-
var inheritStderr = opts.options ? !opts.options.stdio : true;
520+
var inheritStderr = !opts.options.stdio;
521521

522522
var ret = spawnSync(opts.file, opts.options);
523523
ret.cmd = command;

0 commit comments

Comments
 (0)