Since this matches Firefox and Internet Explorer is already developing
<http://status.modern.ie/jsiteratorsietheforoffeature?term=for-> the
feature, shipping this looks great to me. :)
One step closer to ECMAScript 6! Yay.


☆*PhistucK*


On Thu, Aug 7, 2014 at 12:52 PM, Andy Wingo <wi...@igalia.com> wrote:

> Hi,
>
> On Thu 07 Aug 2014 11:31, PhistucK <phist...@gmail.com> writes:
>
> > Does it mean that you also intend to ship @@iterator methods (unclear
> > from your post)?
>
> Yes.
>
> > How much of an effort is implementing the late specification addition? A
> > complete implementation is preferred. Can the lack of it be feature
> > detected quickly (throwing is not very nice to feature detect)?
>
> It's a bit of work, yes -- it effectively causes each for-of block to be
> wrapped in a try-finally.  Since this is the case and it is a late spec
> addition it seems best to wait for the ink to dry first.  Firefox also
> does not implement this part of the spec.
>
> The lack of this facility can be detected, but not easily:
>
>   function detectCloseOnNonlocalForOfExit() {
>     var iter = {
>       next: function() { return { value: 10, done: false }; },
>       close: function() { throw "foo" }
>     }
>     iter[Symbol.iterator] = function() { return this; }
>     try {
>       for (var x of iter) break;
>     } catch (e) { return true; }
>     return false;
>   }
>
> Incidentally, I'm not sure whether the method is to be called "close" or
> "return" -- this is one of those details that I am not sure what the
> latest TC39 resolution was, and the final spec language has not been
> written yet.  Another reason to punt.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to blink-dev+unsubscr...@chromium.org.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to