shim isArray if not exists. correctly report how often this occurs

pull/1/head
ansuz 8 years ago
parent bef5aa0b2b
commit 06f3d0eefe

@ -10,5 +10,13 @@ define([], function () {
"json.sortify": "/bower_components/json.sortify/dist/JSON.sortify"
}
});
// most of CryptPad breaks if you don't support isArray
if (!Array.isArray) {
Array.isArray = function(arg) { // CRYPTPAD_SHIM
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]);
});

@ -1269,7 +1269,7 @@ define([
feedback("NO_PROXIES");
}
if (typeof(Array.isArray) !== 'function') {
if (!/CRYPTPAD_SHIM/.test(Array.isArray.toString())) {
feedback("NO_ISARRAY");
}

Loading…
Cancel
Save