mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
IE8 Compatibility fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
(function () {
|
||||
|
||||
var asciiToArray = function (str) {
|
||||
var arr = new Uint8Array(new ArrayBuffer(str.length));
|
||||
var arr = EJSON.newBinary(str.length);
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var c = str.charCodeAt(i);
|
||||
if (c > 0xFF) {
|
||||
@@ -26,8 +26,8 @@
|
||||
});
|
||||
|
||||
Tinytest.add("base64 - empty", function (test) {
|
||||
test.equal(EJSON._base64Encode(new Uint8Array(new ArrayBuffer(0))), "");
|
||||
test.equal(EJSON._base64Decode(""), new Uint8Array(new ArrayBuffer(0)));
|
||||
test.equal(EJSON._base64Encode(EJSON.newBinary(0)), "");
|
||||
test.equal(EJSON._base64Decode(""), EJSON.newBinary(0));
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -199,7 +199,8 @@ EJSON.parse = function (item) {
|
||||
};
|
||||
|
||||
EJSON.isBinary = function (obj) {
|
||||
return obj instanceof Uint8Array || obj.$Uint8ArrayPolyfill;
|
||||
return (typeof Uint8Array !== 'undefined' && obj instanceof Uint8Array) ||
|
||||
obj.$Uint8ArrayPolyfill;
|
||||
};
|
||||
|
||||
EJSON.equals = function (a, b, options) {
|
||||
|
||||
@@ -208,5 +208,5 @@
|
||||
}
|
||||
|
||||
});
|
||||
OrderedDict.BREAK = {break: true};
|
||||
OrderedDict.BREAK = {"break": true};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user