Browse Source

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 <fedor@indutny.com>
v0.10.29-release
Greg Sabia Tucker 11 years ago
committed by Fedor Indutny
parent
commit
7bd08c5062
  1. 2
      lib/child_process.js

2
lib/child_process.js

@ -711,8 +711,6 @@ var spawn = exports.spawn = function(file /*, args, options*/) {
args = arguments[1].slice(0); args = arguments[1].slice(0);
options = arguments[2]; options = arguments[2];
} else if (arguments[1] && !Array.isArray(arguments[1])) { } else if (arguments[1] && !Array.isArray(arguments[1])) {
args = [];
options = arguments[2];
throw new TypeError('Incorrect value of args option'); throw new TypeError('Incorrect value of args option');
} else { } else {
args = []; args = [];

Loading…
Cancel
Save