cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [1/2] cordova-lib git commit: CB-9935: Cordova CLI silently fails on node.js v5
Date Tue, 03 Nov 2015 01:56:20 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master dc2f79aeb -> 84aaa387e

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 <string>
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.


Branch: refs/heads/master
Commit: 0f1eb6135725090af0af4fc82af29ca62645ed75
Parents: dc2f79a
Author: Jason Ginchereau <>
Authored: Mon Nov 2 16:29:55 2015 -0800
Committer: Jason Ginchereau <>
Committed: Mon Nov 2 16:29:55 2015 -0800

 cordova-lib/src/cordova/restore-util.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
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:
For additional commands, e-mail:

View raw message