yield* desugaring

Andy Wingo wingo at igalia.com
Mon Apr 29 11:56:29 PDT 2013


On Mon 29 Apr 2013 19:25, Ron Buckton <rbuckton at chronicles.org> writes:

> The desugaring for yield* in the face of using { value?, done? } is more likely (without refutable matching or let expressions for the moment):
>
> ```js
> let a;
> {
>     [...]
>     a = result;
> }
> ```

Correct me if I am wrong, but I don't think this works, given that like
"yield X", "yield* X" is an expression.

close() does not seem to have much value given that it isn't part of the
iterators specification, and one can do any needed action by doing a
throw() on the iterator and relying on the generator to have a finally
block if needed.

Andy


More information about the es-discuss mailing list