You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/10/12 01:12:06 UTC

[1/3] js commit: made jslint a bit happier

Updated Branches:
  refs/heads/3.1.x 1517b7047 -> 2fe905b68


made jslint a bit happier


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

Branch: refs/heads/3.1.x
Commit: 55d6354584f6840dae54eb8e5951a59a10156bca
Parents: 8c1ba66
Author: Carlos Santana <cs...@gmail.com>
Authored: Tue Sep 24 18:30:45 2013 -0400
Committer: Carlos Santana <cs...@gmail.com>
Committed: Tue Sep 24 18:32:31 2013 -0400

----------------------------------------------------------------------
 lib/windows8/exec.js | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/55d63545/lib/windows8/exec.js
----------------------------------------------------------------------
diff --git a/lib/windows8/exec.js b/lib/windows8/exec.js
index 4583594..c4858dd 100644
--- a/lib/windows8/exec.js
+++ b/lib/windows8/exec.js
@@ -19,6 +19,9 @@
  *
 */
 
+/*jslint sloppy:true, plusplus:true*/
+/*global require, module, console */
+
 var cordova = require('cordova');
 var commandProxy = require('cordova/windows8/commandProxy');
 
@@ -36,23 +39,23 @@ var commandProxy = require('cordova/windows8/commandProxy');
  * @param {String} action       Action to be run in cordova
  * @param {String[]} [args]     Zero or more arguments to pass to the method
  */
-module.exports = function(success, fail, service, action, args) {
+module.exports = function (success, fail, service, action, args) {
+
+    var proxy = commandProxy.get(service, action),
+        callbackId;
 
-    var proxy = commandProxy.get(service,action);
-    if(proxy) {
-        var callbackId = service + cordova.callbackId++;
+    if (proxy) {
+        callbackId = service + cordova.callbackId++;
         // console.log("EXEC:" + service + " : " + action);
-        if (typeof success == "function" || typeof fail == "function") {
-            cordova.callbacks[callbackId] = {success:success, fail:fail};
+        if (typeof success === "function" || typeof fail === "function") {
+            cordova.callbacks[callbackId] = {success: success, fail: fail};
         }
         try {
             proxy(success, fail, args);
-        }
-        catch(e) {
+        } catch (e) {
             console.log("Exception calling native with command :: " + service + " :: " + action  + " ::exception=" + e);
         }
-    }
-    else {
-        fail && fail("Missing Command Error");
+    } else {
+        return (fail && fail("Missing Command Error"));
     }
 };


[2/3] js commit: [CB-4905] CordovaJS on Windows8 has memoryleak on exec.js

Posted by pu...@apache.org.
[CB-4905] CordovaJS on Windows8 has memoryleak on exec.js


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

Branch: refs/heads/3.1.x
Commit: 668d79fcc89ae04d0102dc27526b07709b9688d8
Parents: 55d6354
Author: Carlos Santana <cs...@gmail.com>
Authored: Tue Sep 24 19:17:17 2013 -0400
Committer: Carlos Santana <cs...@gmail.com>
Committed: Tue Sep 24 19:17:17 2013 -0400

----------------------------------------------------------------------
 lib/windows8/exec.js | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/668d79fc/lib/windows8/exec.js
----------------------------------------------------------------------
diff --git a/lib/windows8/exec.js b/lib/windows8/exec.js
index c4858dd..a8717a3 100644
--- a/lib/windows8/exec.js
+++ b/lib/windows8/exec.js
@@ -42,7 +42,9 @@ var commandProxy = require('cordova/windows8/commandProxy');
 module.exports = function (success, fail, service, action, args) {
 
     var proxy = commandProxy.get(service, action),
-        callbackId;
+        callbackId,
+        onSuccess,
+        onError;
 
     if (proxy) {
         callbackId = service + cordova.callbackId++;
@@ -51,11 +53,28 @@ module.exports = function (success, fail, service, action, args) {
             cordova.callbacks[callbackId] = {success: success, fail: fail};
         }
         try {
-            proxy(success, fail, args);
+            onSuccess = function (result) {
+                cordova.callbackSuccess(callbackId,
+                        {
+                        status: cordova.callbackStatus.OK,
+                        message: result
+                    });
+            };
+            onError = function (err) {
+                cordova.callbackError(callbackId,
+                        {
+                        status: cordova.callbackStatus.ERROR,
+                        message: err
+                    });
+            };
+            proxy(onSuccess, onError, args);
+
         } catch (e) {
             console.log("Exception calling native with command :: " + service + " :: " + action  + " ::exception=" + e);
         }
     } else {
-        return (fail && fail("Missing Command Error"));
+        if (typeof fail === "function") {
+            fail("Missing Command Error");
+        }
     }
 };


[3/3] js commit: Merge branch 'fixMemoryLeak' of https://github.com/csantanapr/cordova-js into 3.1.x

Posted by pu...@apache.org.
Merge branch 'fixMemoryLeak' of https://github.com/csantanapr/cordova-js into 3.1.x


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

Branch: refs/heads/3.1.x
Commit: 2fe905b68c417bc8a988e4ba300688ffb6262f96
Parents: 1517b70 668d79f
Author: purplecabbage <pu...@gmail.com>
Authored: Fri Oct 11 16:07:45 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Fri Oct 11 16:07:45 2013 -0700

----------------------------------------------------------------------
 lib/windows8/exec.js | 46 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 12 deletions(-)
----------------------------------------------------------------------