Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A197918E7A for ; Tue, 3 Nov 2015 01:56:59 +0000 (UTC) Received: (qmail 14001 invoked by uid 500); 3 Nov 2015 01:56:59 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 13965 invoked by uid 500); 3 Nov 2015 01:56:59 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 13952 invoked by uid 99); 3 Nov 2015 01:56:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 01:56:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 619ADE097A; Tue, 3 Nov 2015 01:56:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Tue, 03 Nov 2015 01:56:59 -0000 Message-Id: <8937461ba70c4e14b3642d3766eb942d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] cordova-lib git commit: CB-9935: Cordova CLI silently fails on node.js v5 Repository: cordova-lib Updated Branches: refs/heads/5.4.x 1ce6a5a24 -> d5927721c CB-9935: Cordova CLI silently fails on node.js v5 Cordova in a couple places was mis-using the Q.all() function from the Q promises library. That function expects an array (of values or promises), but Cordova was passing a single string parameter. The string was actually being reduced like an array. Previously that happened to work out OK: the result was an array of fulfilled single-character promises. But one line of code in Q that worked on node.js v4 now fails on node.js v5, where because of the bad parameter it ends up assigning a value to an index of the string: exception in cordova-lib\node_modules\q\q.js:1490 > promises[index] = value; TypeError: Cannot assign to read only property '0' of It appears the newer version of V8 is a little more strict about assigning to a string index. The fix is simply to use Q() instead of Q.all() when the intention is to return a single fulfilled promise of type string. Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/0e052f2f Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/0e052f2f Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/0e052f2f Branch: refs/heads/5.4.x Commit: 0e052f2ff86f303209bce4ee2636914217f3717f Parents: 1ce6a5a Author: Jason Ginchereau Authored: Mon Nov 2 16:29:55 2015 -0800 Committer: Steve Gill Committed: Mon Nov 2 17:56:40 2015 -0800 ---------------------------------------------------------------------- cordova-lib/src/cordova/restore-util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/0e052f2f/cordova-lib/src/cordova/restore-util.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/restore-util.js b/cordova-lib/src/cordova/restore-util.js index c80ade7..102e302 100644 --- a/cordova-lib/src/cordova/restore-util.js +++ b/cordova-lib/src/cordova/restore-util.js @@ -55,7 +55,7 @@ function installPlatformsFromConfigXML(platforms, opts) { }); if (!targets || !targets.length) { - return Q.all('No platforms are listed in config.xml to restore'); + return Q('No platforms are listed in config.xml to restore'); } @@ -87,7 +87,7 @@ function installPluginsFromConfigXML(args) { // Get all configured plugins var plugins = cfg.getPluginIdList(); if (0 === plugins.length) { - return Q.all('No config.xml plugins to install'); + return Q('No config.xml plugins to install'); } // CB-9560 : Run `plugin add` serially, one plugin after another --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org