FIX: polyfills forEach support on NodeList for IE11 (#8213)

This commit is contained in:
Joffrey JAFFEUX 2019-10-18 12:27:51 +02:00 committed by GitHub
parent ac06c87b43
commit 2fa3808928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -356,4 +356,14 @@ if (!String.prototype.repeat) {
};
}
// https://developer.mozilla.org/fr/docs/Web/API/NodeList/forEach
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function(callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
/* eslint-enable */