From f85d3471eee786f3e04f204c1c9eff39245a763e Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 23 Sep 2022 20:59:52 -0400 Subject: [PATCH] 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 Reviewed-By: Rich Trott --- lib/child_process.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/child_process.js b/lib/child_process.js index 6ce21363e1ee6a..335de95ec06a99 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -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;