GitHub user jasongin opened a pull request:
https://github.com/apache/cordova-lib/pull/338
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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jasongin/cordova-lib CB-9935
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/338.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #338
----
commit 0f1eb6135725090af0af4fc82af29ca62645ed75
Author: Jason Ginchereau <[email protected]>
Date: 2015-11-03T00:29:55Z
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.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]