Skip to content

Commit 73b3905

Browse files
Merge pull request #32 from SheetJS/master
Adobe ExtendScript errors
2 parents b17e0e0 + 4f7282e commit 73b3905

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

base64.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
;(function () {
22

3-
var object = typeof exports != 'undefined' ? exports : self; // #8: web workers
3+
var object =
4+
typeof exports != 'undefined' ? exports :
5+
typeof self != 'undefined' ? self : // #8: web workers
6+
$.global; // #31: ExtendScript
7+
48
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
59

610
function InvalidCharacterError(message) {
@@ -37,7 +41,7 @@
3741
// [https://gist.github.com/1020396] by [https://github.com/atk]
3842
object.atob || (
3943
object.atob = function (input) {
40-
var str = String(input).replace(/=+$/, '');
44+
var str = String(input).replace(/[=]+$/, ''); // #31: ExtendScript bad parse of /=
4145
if (str.length % 4 == 1) {
4246
throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
4347
}

base64.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)