Remove btoa from domstubs.js

btoa is already defined by src/shared/compatibility.js,
which is unconditionally imported by src/shared/util.js.
This commit is contained in:
Rob Wu 2017-07-06 14:54:21 +02:00
parent a488ff4f70
commit 3479a19bf0

View File

@ -41,24 +41,6 @@ function xmlEncode(s){
return buf;
}
function btoa(chars) {
var digits =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
var buffer = '';
var i, n;
for (i = 0, n = chars.length; i < n; i += 3) {
var b1 = chars.charCodeAt(i) & 0xFF;
var b2 = chars.charCodeAt(i + 1) & 0xFF;
var b3 = chars.charCodeAt(i + 2) & 0xFF;
var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4);
var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64;
var d4 = i + 2 < n ? (b3 & 0x3F) : 64;
buffer += (digits.charAt(d1) + digits.charAt(d2) +
digits.charAt(d3) + digits.charAt(d4));
}
return buffer;
}
function DOMElement(name) {
this.nodeName = name;
this.childNodes = [];
@ -171,7 +153,6 @@ Image.prototype = {
}
}
exports.btoa = btoa;
exports.document = document;
exports.Image = Image;