y. Iterators are themselves iterable, so you can for/of an interator (which
happens to be a generator), exit the for/of loop early, and currently
resume the iterator. Were we to adopt the proposal, when the iterator is a
generator, it would not be resumable.


On Fri, Apr 25, 2014 at 12:46 PM, C. Scott Ananian <[email protected]>wrote:

> On Fri, Apr 25, 2014 at 3:12 PM, Mark S. Miller <[email protected]>wrote:
>
>> I would really like to believe that this is adequate to postpone the rest
>> of this issue to ES7. But even without finally, this proposal would put the
>> generator in a non-resumable state in ES7 after ES6 would ship them in a
>> resumable state. I don't think that's realistic.
>>
>
> But is that user-visible?  We're talking about `for-of` and uses inside
> `Array.from` and other built-ins.  I don't think the user can get at the
> raw iterator instance in any of these cases, so they should not be able to
> observe the generator state.  Am I missing something?
>   --scott
>



-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to