From e39c6956f2b6d0a15c5629b22ea7af6b844b6e9e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 23 Oct 2015 02:12:29 -0700 Subject: [PATCH] mobile safari fix --- 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 9b57d7c..c0f4c8f 100644 --- a/bower_components/unibabel/unibabel.base32.js +++ b/bower_components/unibabel/unibabel.base32.js @@ -131,7 +131,12 @@ exports.base32ToBuffer = function(encoded) { throw new Error('Invalid input - it is not base32 encoded string'); } } - return decoded.slice(0, plainPos); + if (decoded.slice) { + return decoded.slice(0, plainPos); + } else { + // Mobile Safari's Uint8Array doesn't have slice + return Array.prototype.slice.apply(decoded, 0, plainPos); + } }; }(window.Unibabel || window));