Skip to content

Commit b867294

Browse files
cjihrigMylesBorins
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 0cffa3c commit b867294

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
@@ -512,7 +512,7 @@ exports.execFileSync = execFileSync;
512512

513513
function execSync(command /*, options*/) {
514514
var opts = normalizeExecArgs.apply(null, arguments);
515-
var inheritStderr = opts.options ? !opts.options.stdio : true;
515+
var inheritStderr = !opts.options.stdio;
516516

517517
var ret = spawnSync(opts.file, opts.options);
518518
ret.cmd = command;

0 commit comments

Comments
 (0)