Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: polyfill.js

Issue 29625598: Issue 6110 - Add the iterator polyfills to the test page (Closed)
Patch Set: Created Nov. 30, 2017, 11:28 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: polyfill.js
diff --git a/polyfill.js b/polyfill.js
index b00d4e5d79c6ab6024fd76b33da0a4781a20f7b8..8775d310781eef20ffeec703456b57d806cda02a 100644
--- a/polyfill.js
+++ b/polyfill.js
@@ -137,4 +137,13 @@
}
}
};
+
+ // Workaround since HTMLCollection, NodeList, StyleSheetList, and CSSRuleList
+ // didn't have iterator support before Chrome 51.
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=401699
+ for (let object of [HTMLCollection, NodeList, StyleSheetList, CSSRuleList])
+ {
+ if (!(Symbol.iterator in object.prototype))
+ object.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
+ }
}());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld