Skip to content

Commit

Permalink
child_process: remove lookup of undefined property
Browse files Browse the repository at this point in the history
execSync() passes opts.args to checkExecSyncError(). There are
two problems:

1. opts.args appears to always be undefined.
2. Even if it was defined, checkExecSyncError() would not use
   it since the command input is guaranteed to be defined.

This commit updates the code to pass undefined instead.

PR-URL: #44766
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
cjihrig authored and juanarbol committed Oct 4, 2022
1 parent ffb4341 commit 5d48fa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ function execSync(command, options) {
if (inheritStderr && ret.stderr)
process.stderr.write(ret.stderr);

const err = checkExecSyncError(ret, opts.args, command);
const err = checkExecSyncError(ret, undefined, command);

if (err)
throw err;
Expand Down

0 comments on commit 5d48fa5

Please sign in to comment.