>> 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`?

Maybe I overstated, maybe documenting whether an iterable produces continuable 
iterators is enough, but it is something to be aware of, something that has to 
be explained in conjunction with the iteration protocol. Similarly: whether an 
iterable restarts iteration every time you call `[Symbol.iterator]()` 
(generators don’t restart, arrays do).

-- 
Dr. Axel Rauschmayer
a...@rauschma.de
rauschma.de



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

Reply via email to