Skip to content

Commit

Permalink
Fix: Add NodeList.forEach polyfill for IE (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinHoldstock committed Nov 27, 2018
1 parent 1a71790 commit 8f3a024
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,10 @@ if (!String.prototype.startsWith) {
return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
};
}

// NodeList.prototype.forEach polyfill for IE11
// https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = Array.prototype.forEach;
}
/* eslint-enable */

0 comments on commit 8f3a024

Please sign in to comment.