yield* desugaring

David Herman dherman at mozilla.com
Tue Apr 30 17:06:15 PDT 2013

On Apr 30, 2013, at 4:55 PM, David Herman <dherman at mozilla.com> wrote:

> On Apr 30, 2013, at 7:25 AM, Brendan Eich <brendan at mozilla.com> wrote:
>> Andreas Rossberg wrote:
>>> And as Andy points out correctly, that raises the question whether
>>> having 'close' makes much sense at all.
>> I think we have evolved away from it. Cc'ing Dave to confirm.
> I'm cool with it, and I agree on type grounds as well: forcing a return without a value may break the expected return type of the generator, which might not want to return undefined. Whereas the "throws" type makes more sense as an open, extensible type.

It also has a smell to it: the idea that an expression can cause a return, without the syntactic appearance of `return`. (I'm not opposed to the idea of being able to return from expressions -- I still love do-expressions. But I prefer `return` to be a syntactically apparent control effect.)


More information about the es-discuss mailing list