Should JS iterators implement Dart Iterable? #28320
Labels
area-web-js
Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.
type-enhancement
A request for a change that isn't a bug
web-js-interop
Issues that impact all js interop
From @jmesserly on June 25, 2015 23:26
This seems like it would be useful in general. The downside is that something could have
[Symbol.iterator]()
but already define some of the same method names as Dart's Iterable, so we'd have to decide which one wins (at least, for dynamic dispatch).Without this, we won't have very good interop with JS generators, so IMO it's worth it. It would also simplify
sync*
(#221), so Dart generators just get Iterable "for free". Otherwise we'll have to wrap the ES6 generator.Exposing explicit conversion APIs would be the other way to go here.
See also #245, a similar issue with Future/Promise.
Copied from original issue: dart-archive/dev_compiler#247
The text was updated successfully, but these errors were encountered: