> Le 23 juin 2015 à 14:58, Gary Guo <[email protected]> a écrit :
> 
> To me it seems that spread expression will not call IteratorClose (neither in 
> ArrayLiteral nor in Argument List), but IteratorClose is called in other 
> places in the spec where iterators are used, ex. for-of, destructuring, 
> builtin functions). Is this intended or this is a bug in the spec?
> 
> Gary Guo

In spread expressions for instance, the iterator is supposed to close itself, 
either when it is exhausted or when it throws an exception.

But in some places, like for/of loops or destructuring assignments, an abrupt 
completion may come from an other source than the iterator being traversed; in 
which case (and only in that case) the iterator is explicitly closed.

—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to