for-of loops, IteratorClose and the rest of the iterations in the spec

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Sep 10 08:56:53 PDT 2014


On Sep 10, 2014, at 8:29 AM, Mark S. Miller wrote:

> Hi Allen, does that mean we agreed to the equivalent of Arv's #1? If so, great!

We agree at our June meeting to add the "return" method to generators and to conditionally call "return" (if it is present) when a for-of loop terminates before it exhausts its generator. See https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-06/jun-5.md#conclusionresolution-2  .  IteratorClose is part of the implementation of this features and was added in Rev 27 of the spec.

I believe that #1 is implicit in that decision as it has always been an ES6 goal that most library methods should be self-hostable in ES. That means that for-of like iteration in those methods should be specified in a manner that matches the observable semantics of for-of.

Allen


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140910/2c093f2c/attachment.html>


More information about the es-discuss mailing list