You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/01/21 22:43:17 UTC

js commit: [android] Fix exec bridge when calls contain null.

Updated Branches:
  refs/heads/master 369d1ea4f -> 71223711f


[android] Fix exec bridge when calls contain null.

https://issues.apache.org/jira/browse/CB-2279


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

Branch: refs/heads/master
Commit: 71223711fb1591b1255d871140d959fd9095f0c3
Parents: 369d1ea
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Jan 21 16:41:59 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Jan 21 16:42:52 2013 -0500

----------------------------------------------------------------------
 lib/android/exec.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/71223711/lib/android/exec.js
----------------------------------------------------------------------
diff --git a/lib/android/exec.js b/lib/android/exec.js
index 4810e07..506fd3d 100644
--- a/lib/android/exec.js
+++ b/lib/android/exec.js
@@ -35,6 +35,7 @@
  */
 var cordova = require('cordova'),
     nativeApiProvider = require('cordova/plugin/android/nativeapiprovider'),
+    utils = require('cordova/utils'),
     jsToNativeModes = {
         PROMPT: 0,
         JS_OBJECT: 1,
@@ -72,7 +73,7 @@ function androidExec(success, fail, service, action, args) {
 
     // Process any ArrayBuffers in the args into a string.
     for (var i = 0; i < args.length; i++) {
-        if (args[i].constructor == ArrayBuffer || (args[i].buffer && args[i].buffer.constructor == ArrayBuffer)) {
+        if (utils.typeName(args[i]) == 'ArrayBuffer') {
             args[i] = window.btoa(String.fromCharCode.apply(null, new Uint8Array(args[i])));
         }
     }