You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2013/10/21 14:59:51 UTC
webworks commit: Adding a missing null check -Rewriting boolean
equation for readability
Updated Branches:
refs/heads/master 6095888ac -> e5af8fae3
Adding a missing null check
-Rewriting boolean equation for readability
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/e5af8fae
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/e5af8fae
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/e5af8fae
Branch: refs/heads/master
Commit: e5af8fae30da93379016eb26b73f845a086abf46
Parents: 6095888
Author: Jeffrey Heifetz <jh...@blackberry.com>
Authored: Fri Oct 18 14:04:58 2013 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Mon Oct 21 09:04:09 2013 -0400
----------------------------------------------------------------------
.../bin/templates/project/cordova/lib/target-utils.js | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/e5af8fae/blackberry10/bin/templates/project/cordova/lib/target-utils.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/target-utils.js b/blackberry10/bin/templates/project/cordova/lib/target-utils.js
index 3e83200..9ca6be4 100644
--- a/blackberry10/bin/templates/project/cordova/lib/target-utils.js
+++ b/blackberry10/bin/templates/project/cordova/lib/target-utils.js
@@ -229,7 +229,15 @@ _self = {
bb10_utils.exec(script, args, options, function (error, stdout, stderr) {
// error code 3 corresponds to a connected device, null or "Error: null" in stderr corresponds to connected simulator
- callback((type === 'simulator' && (error === null || stderr.length === 0 || stderr.indexOf('Error: null') >= 0 || stderr.indexOf('Error: Authentication failed') >= 0)) || (type === 'device' && error.code === 3));
+ var isSimConnected = (type === "simulator" && (
+ error === null ||
+ stderr.length === 0 ||
+ stderr.indexOf('Error: null') >= 0 ||
+ stderr.indexOf('Error: Authentication failed') >= 0
+ )),
+ isDeviceConnected = (type === "device" && error && error.code === 3);
+
+ callback(isSimConnected || isDeviceConnected);
});
},