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

This commit is contained in:
ansuz
2017-05-15 10:26:52 +02:00
parent bef5aa0b2b
commit 06f3d0eefe
2 changed files with 9 additions and 1 deletions

View File

@@ -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')]);
});