From 46e59073a3b51b2cbff009cae3194ffd439986c7 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 364f908158c..a4def6acce9 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -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;