Steps to reproduce
NodeList.prototype[Symbol.iterator] // undefined on Edge, should be valid iterator
NodeList should support iterator.
Dev Channel specific:
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “Mara P.”
Changed Assigned To to “Christian F.”
Changed Assigned To to “Travis L.”
Changed Assigned To from “Travis L.” to “IE S.”
Changed Status to “External”
Mentioned #5382428 is inaccessible: https://connect.microsoft.com/IE/feedback/details/2186079/nodelist-should-be-iterable
Other browsers are shipping entries(), keys(), values(), forEach() in NodeList. Developers should be able to iterate NodeList that is used in common cases like document.getElementByClassNames()
It will be very helpful if MSEdge team:
1. provides some details when closing an issue.
2. does not close an issue because it is ‘non-trivial’ to fix.
Sorry, ‘does not close an issue’->’does not tag an issue as External’
This also affects the spread operator, which fails with a “Function expected” exception when used with a
NodeList. Here’s an example:
var myArr = [...document.querySelectorAll("div")]
NodeListreturned by Document.querySelectorAll should be spread into array
myArr, but instead throws an exception since
NodeListis not iterable. Works in Chrome, Firefox, and Safari.
Thank you for providing this information about the issue. We have confirmed the problem, and we are working on a solution for a future build of Edge. We are presently tracking this issue as a duplicate of an existing internal bug report. We look forward to additional feedback you may have on how we can improve Microsoft Edge.
The MS Edge Team
As far as I can tell, this seems to have been resolved in a newer Edge release. It’s working as expected for me in Edge 16.
This issue does not seem resolved for me in Edge 17.
Update: the issue is resolved with NodeList but is still present with HTMLCollections.
List of iterable DOM collections
not all of them are in https://github.com/Microsoft/TSJS-lib-generator/blob/master/baselines/dom.iterable.generated.d.ts
So it seems that not all of them are iterable in Edge’s WebIDL