Skip to content
Browse files
child_process: remove lookup of undefined property
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 <>
Reviewed-By: Rich Trott <>
  • Loading branch information
cjihrig authored and danielleadams committed Oct 5, 2022
1 parent 4e82521 commit f85d3471eee786f3e04f204c1c9eff39245a763e
Showing 1 changed file with 1 addition and 1 deletion.
@@ -940,7 +940,7 @@ function execSync(command, options) {
if (inheritStderr && ret.stderr)

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

if (err)
throw err;

0 comments on commit f85d347

Please sign in to comment.