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: https://github.com/nodejs/node/pull/44766
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
cjihrig committed 2022-09-28 20:00:37 -04:00
1 parent 5118c31a3b
commit df92b3c64b
1 file changed
+1 -1
+1 -1
View File
@@ -940,7 +940,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;