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/29 20:07:52 UTC
[6/37] js commit: [ios] removing use of instanceof
[ios] removing use of instanceof
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/f43f1dfb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/f43f1dfb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/f43f1dfb
Branch: refs/heads/symbolmapping
Commit: f43f1dfbced6bde0048efd77d7632aaed3cac7fa
Parents: 50be7a3
Author: Michal Mocny <mm...@gmail.com>
Authored: Fri Jan 18 13:46:12 2013 -0500
Committer: Michal Mocny <mm...@gmail.com>
Committed: Fri Jan 18 13:46:25 2013 -0500
----------------------------------------------------------------------
lib/ios/exec.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f43f1dfb/lib/ios/exec.js
----------------------------------------------------------------------
diff --git a/lib/ios/exec.js b/lib/ios/exec.js
index e0dd8de..89d7615 100644
--- a/lib/ios/exec.js
+++ b/lib/ios/exec.js
@@ -72,12 +72,12 @@ function massageArgsJsToNative(args) {
return window.btoa(encodeArrayBufferAs8bitString(ab));
};
args.forEach(function(arg, i) {
- if (arg instanceof ArrayBuffer) {
+ if (Object.prototype.toString.call(arg).slice(8, -1) == 'ArrayBuffer') {
args[i] = {
'CDVType': 'ArrayBuffer',
'data': encodeArrayBufferAsBase64(arg)
};
- } // else if (arg instanceof OTHER_TYPE)
+ }
});
return args;
}