Proposal: Generator returning a value should throw SyntaxError

Brendan Eich brendan at
Thu Sep 26 19:00:40 PDT 2013

Sorry, premature send!
> Brendan Eich <mailto:brendan at>
> September 26, 2013 6:57 PM
> We deliberated long and hard, after going through a design state 
> without return expr;, on this. We agree with

We want return expr; -- not for the 'for-of' special forms, which 
clients use knowingly to consume in-band values, not the OOB return 
value -- but for the case of generators used as tasks (see ), where the 
scheduler can make good use of the return value:


More information about the es-discuss mailing list