Axel Rauschmayer wrote:
a difference between iterators that you have to be aware of and that needs to 
be documented per iterable.

Alternatively, just test `if (typeof iterator.return == "function")` :-)
But yes, awareness is required. Maybe we should dub "closeable iterators" as a subtype of the iterator interface?

It’d be great if all iterables were indeed the same in this regard.

What do you suggest, that array iterators should not be continuable? So we'd have `.return()` methods on ArrayIterators, StringIterators, MapIterators, and SetIterators, which sets the respective [[Iterated*]] internal property to `undefined`?

 Bergi
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to