cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [16/26] js commit: [Amazon related change] base64.toArrayBuffer to convert base64 strings according to https://git-wip-us.apache.org/repos/asf?p=cordova-js.git; a=commit; h=6fde14b81988b1eb118c42f47cbdfbb08d756256
Date Wed, 07 Jan 2015 01:27:15 GMT
[Amazon related change] base64.toArrayBuffer to convert base64 strings
according to https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=6fde14b81988b1eb118c42f47cbdfbb08d756256


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

Branch: refs/heads/3.7.x
Commit: 5668a398cb8e461b9f6b4cfa5e66efb78557f75b
Parents: ccac738
Author: Ajitha <ajithas@amazon.com>
Authored: Sat Dec 13 19:36:34 2014 +0000
Committer: Archana Naik <naika@lab126.com>
Committed: Mon Dec 22 08:00:14 2014 -0800

----------------------------------------------------------------------
 src/amazon-fireos/exec.js | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/5668a398/src/amazon-fireos/exec.js
----------------------------------------------------------------------
diff --git a/src/amazon-fireos/exec.js b/src/amazon-fireos/exec.js
index 856bd8e..87cd52c 100644
--- a/src/amazon-fireos/exec.js
+++ b/src/amazon-fireos/exec.js
@@ -194,12 +194,7 @@ function buildPayload(payload, message) {
         payload.push(+message.slice(1));
     } else if (payloadKind == 'A') {
         var data = message.slice(1);
-        var bytes = window.atob(data);
-        var arraybuffer = new Uint8Array(bytes.length);
-        for (var i = 0; i < bytes.length; i++) {
-            arraybuffer[i] = bytes.charCodeAt(i);
-        }
-        payload.push(arraybuffer.buffer);
+        payload.push(base64.toArrayBuffer(data));
     } else if (payloadKind == 'S') {
         payload.push(window.atob(message.slice(1)));
     } else if (payloadKind == 'M') {


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


Mime
View raw message