From 92b62946d39b380a8ef2ce18ad406b7736ebffd5 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 23 Oct 2015 02:39:29 -0700 Subject: [PATCH] debugging mobile safari --- bower_components/unibabel/unibabel.base32.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bower_components/unibabel/unibabel.base32.js b/bower_components/unibabel/unibabel.base32.js index 219f815..7e4142a 100644 --- a/bower_components/unibabel/unibabel.base32.js +++ b/bower_components/unibabel/unibabel.base32.js @@ -95,6 +95,7 @@ exports.base32ToBuffer = function(encoded) { } else { decoded = new Array(len); } + console.log('debug mobile safari: decoded', decoded); /* byte by byte isn't as pretty as octet by octet but tests a bit faster. will have to revisit. */ @@ -131,11 +132,15 @@ exports.base32ToBuffer = function(encoded) { throw new Error('Invalid input - it is not base32 encoded string'); } } + + console.log('debug mobile safari: decoded 2', decoded); if (decoded.slice) { + console.log('debug mobile safari: decoded 3a', decoded); return decoded.slice(0, plainPos); } else { + console.log('debug mobile safari: decoded 3b', decoded); // Mobile Safari's Uint8Array doesn't have slice - return Array.prototype.slice.call(decoded, 0, plainPos); + return new Uint8Array(Array.prototype.slice.call(decoded, 0, plainPos)); } };