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>
This commit is contained in:
parent
885142a5ed
commit
7bd08c5062
@ -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…
x
Reference in New Issue
Block a user