Skip to content

Commit dd13d71

Browse files
committed
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 <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>
1 parent a508000 commit dd13d71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/child_process.js

Lines changed: 1 addition & 1 deletion
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)