You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2015/05/12 23:16:29 UTC

js commit: CB-8996 (Windows) Fixed invalid null comparison. This closes #110.

Repository: cordova-js
Updated Branches:
  refs/heads/master b0463746d -> 53bacf736


CB-8996 (Windows) Fixed invalid null comparison. This closes #110.


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/53bacf73
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/53bacf73
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/53bacf73

Branch: refs/heads/master
Commit: 53bacf736379f91295957360a8ad3a127f38b5fb
Parents: b046374
Author: alsorokin <al...@akvelon.com>
Authored: Tue May 12 16:32:02 2015 +0300
Committer: Dmitry Blotsky <dm...@gmail.com>
Committed: Tue May 12 14:15:49 2015 -0700

----------------------------------------------------------------------
 src/windows/exec.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/53bacf73/src/windows/exec.js
----------------------------------------------------------------------
diff --git a/src/windows/exec.js b/src/windows/exec.js
index d7f0c0f..18f559a 100644
--- a/src/windows/exec.js
+++ b/src/windows/exec.js
@@ -61,7 +61,11 @@ module.exports = function (success, fail, service, action, args) {
             onSuccess = function (result, callbackOptions) {
                 callbackOptions = callbackOptions || {};
                 var callbackStatus;
-                if (callbackOptions.status !== null) {
+                // covering both undefined and null.
+                // strict null comparison was causing callbackStatus to be undefined
+                // and then no callback was called because of the check in cordova.callbackFromNative
+                // see CB-8996 Mobilespec app hang on windows
+                if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
                     callbackStatus = callbackOptions.status;
                 }
                 else {
@@ -77,7 +81,11 @@ module.exports = function (success, fail, service, action, args) {
             onError = function (err, callbackOptions) {
                 callbackOptions = callbackOptions || {};
                 var callbackStatus;
-                if (callbackOptions.status !== null) {
+                // covering both undefined and null.
+                // strict null comparison was causing callbackStatus to be undefined
+                // and then no callback was called because of the check in cordova.callbackFromNative
+                // see CB-8996 Mobilespec app hang on windows
+                if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
                     callbackStatus = callbackOptions.status;
                 }
                 else {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org