From 7bd08c5062bdcd2a71ddd9d79bd3e080f1e48090 Mon Sep 17 00:00:00 2001 From: Greg Sabia Tucker Date: Tue, 13 May 2014 22:32:57 -0700 Subject: [PATCH] child_process: do not set args before throwing No point in setting args and options if TypeError is being thrown. fix #7456 Signed-off-by: Fedor Indutny --- lib/child_process.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index 5e3eeaf..a07f2d1 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -711,8 +711,6 @@ var spawn = exports.spawn = function(file /*, args, options*/) { args = arguments[1].slice(0); options = arguments[2]; } else if (arguments[1] && !Array.isArray(arguments[1])) { - args = []; - options = arguments[2]; throw new TypeError('Incorrect value of args option'); } else { args = []; -- 2.7.4