Closed
Description
Update: This issue is now only for the following collections:
- MediaList
- StyleSheetList
- CSSRuleList
Originally it was about NodeList as well, but that was fixed (along with DOMTokenList) in #3393
Original:
var paragraphs = document.querySelectorAll("p");
for (let p of paragraphs) {
console.log(p);
}
foo.ts(2,15): error TS2488: The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator.
Seems it just needs an update to lib.es6.d.ts to add the [Symbol.iterator()]
to all the collections that have an indexer and length property. The ones I found that have it in Nightly are below. The rest were either IE-only or didn't exist. Removed my list since it seems FF has more than the specs allow. See zloirock/core-js#137 (comment) for a more accurate list.