Andy Wingo (2014-07-23T16:51:38.000Z)
On Wed 23 Jul 2014 18:19, Allen Wirfs-Brock <allen at wirfs-brock.com> writes:

> On Jul 23, 2014, at 1:25 AM, Andy Wingo wrote:
>
>     The TC39 notes do not record any discussion of return() causing an
>     exception to be thrown.
>     
>
> In the latest ES6 draft for-of propagates any exceptions thrown by the
> call to return(). See
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-
> forin-div-ofbodyevaluation step 3.k.ii.1-2 
>
> As a matter of design policy we rarely, if ever, just drop exceptions.

I probably didn't explain myself completely; apologies.  I meant that
the mechanism of iter.return() should be implemented by throwing an
exception (i.e., as if by "iter.throw(new StopIteration)") instead of
"returning" from the yield point.

Andy
domenic at domenicdenicola.com (2014-07-31T18:26:17.319Z)
On Wed 23 Jul 2014 18:19, Allen Wirfs-Brock <allen at wirfs-brock.com> writes:

> In the latest ES6 draft for-of propagates any exceptions thrown by the
> call to return(). See
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-
> forin-div-ofbodyevaluation step 3.k.ii.1-2 
>
> As a matter of design policy we rarely, if ever, just drop exceptions.

I probably didn't explain myself completely; apologies.  I meant that
the mechanism of `iter.return()` should be implemented by throwing an
exception (i.e., as if by `iter.throw(new StopIteration)`) instead of
"returning" from the yield point.