yield* desugaring

David Herman dherman at mozilla.com
Mon May 13 21:04:20 PDT 2013

On May 13, 2013, at 6:11 PM, Brendan Eich <brendan at mozilla.com> wrote:

> We've been over this at least twice. Let's get it right. No close, yield in try-with-finally ok.


> Merge next and send by letting next take an optional parameter? Ok by me.


> Make yield* work on any {next, throw}, not necessary but ok by me too.

Yes with one delta: if there's no .throw it still works, it just defaults to (x) => { throw x }. This way you can write ordinary iterators without having to worry about providing the default throw, and they still function properly as generators.


More information about the es-discuss mailing list