Files
cocos4/test/qunit/unit/_polyfill-for-phantom.js
T

19 lines
387 B
JavaScript

if (typeof CustomEvent === 'undefined') {
CustomEvent = function () {
}
}
if (typeof Set == 'undefined') {
// very simple polyfill
Set = function () {
this.values = [];
};
Set.prototype.has = function (value) {
return this.values.indexOf(value) !== -1;
};
Set.prototype.add = function (value) {
this.values.push(value);
};
}