From adde1be3b7b60be54cf8e43fde363319e57d722a Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 29 Oct 2015 18:05:04 -0400 Subject: [PATCH] Fix create argument prerequisite check Store argument.length from create before return call Update returns prerequisite checks to use the previously stored arg length --- cordova-lib/src/cordova/create.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cordova-lib/src/cordova/create.js b/cordova-lib/src/cordova/create.js index 1eded17e2..1f5e010b6 100644 --- a/cordova-lib/src/cordova/create.js +++ b/cordova-lib/src/cordova/create.js @@ -39,13 +39,15 @@ var path = require('path'), // Returns a promise. module.exports = create; function create(dir, optionalId, optionalName, cfg) { + var argumentCount = arguments.length; + return Q.fcall(function() { // Lets check prerequisites first - if (arguments.length == 3) { + if (argumentCount == 3) { cfg = optionalName; optionalName = undefined; - } else if (arguments.length == 2) { + } else if (argumentCount == 2) { cfg = optionalId; optionalId = undefined; optionalName = undefined;