Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map interface should implement iterator() getter for compat with ES Map #21491

Closed
DartBot opened this issue Nov 2, 2014 · 6 comments
Closed
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

Comments

@DartBot
Copy link

DartBot commented Nov 2, 2014

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 of entries() 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.

@iposva-google
Copy link
Contributor

Added Area-Library, Library-Core, Triaged labels.

@lrhn
Copy link
Member

lrhn commented Nov 2, 2014

Removed Type-Defect label.
Added Type-Enhancement label.

@lrhn
Copy link
Member

lrhn commented Nov 3, 2014

We are unlikely to change the Map interface at this point.

@DartBot
Copy link
Author

DartBot commented Nov 4, 2014

This comment was originally written by @seaneagan


This is another duplicate (at least the 4th one) of issue #7088. Issue #16117 as well. Clearly this is a much-desired feature. There has been no comment yet from the dart team on issue #7088.

@DartBot
Copy link
Author

DartBot commented Nov 4, 2014

This comment was originally written by caitpotter8...@gmail.com


Ah, my duplicate-finding skills on code.google.com are even worse than they are on github =)

We can work around this in angular if it's not provided by the standard library --- but it would be so much better (not just for Angular, but for everyone) if the Map interface were extended to include this.

However, lrn@ indicates that Map is likely to be crippled forever, so it may not come to pass. That would be a pity.

@lrhn
Copy link
Member

lrhn commented Nov 6, 2014

Added Duplicate label.
Marked as being merged into #7088.

@DartBot DartBot added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core closed-duplicate Closed in favor of an existing report labels Nov 6, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants