NodeList should be iterable

External Issue #5998615

Details

Created
Dec 31, 2015
Privacy
This issue is public.
Reports
Reported by 15 people

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

NodeList.prototype[Symbol.iterator] // undefined on Edge, should be valid iterator

Expected Results:

NodeList should support iterator.

Actual Results:

Dev Channel specific:

No

Attachments

0 attachments

    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”

    • https://developer.mozilla.org/en-US/docs/Web/API/NodeList
      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")]
      

      The NodeList returned by Document.querySelectorAll should be spread into array myArr, but instead throws an exception since NodeList is not iterable. Works in Chrome, Firefox, and Safari.

    • Hello,

      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.

      Best Wishes,
      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
      https://github.com/zloirock/core-js#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

    You need to sign in to your Microsoft account to add a comment.

    Sign in