cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [11/37] js commit: [android] Fix exec bridge when calls contain null.
Date Tue, 29 Jan 2013 19:07:52 GMT
[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/symbolmapping
Commit: 71223711fb1591b1255d871140d959fd9095f0c3
Parents: 369d1ea
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Mon Jan 21 16:41:59 2013 -0500
Committer: Andrew Grieve <agrieve@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])));
         }
     }


Mime
View raw message