Map interface should implement iterator() getter for compat with ES Map #21491
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-duplicate
Closed in favor of an existing report
library-core
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by caitpot...@gmail.com
ES includes a default iterator for Map classes, https://people.mozilla.org/~jorendorff/es6-draft.html#sec-map.prototype-@@iterator --- making them useful in
for...of
loops.For code which transpiles to dart (such as https://github.com/angular/angular), it would be useful if we could trust that classes which are iterable in ES are also iterable in Dart.
This would mean exposing an
entries()
method on Map, and returning the value ofentries()
as the default iterator for the object.Is there some reason why this was not done to begin with? The method should still be overridable in subclasses, if needed.
The text was updated successfully, but these errors were encountered: