yield* desugaring

Ron Buckton rbuckton at chronicles.org
Mon Apr 29 12:02:49 PDT 2013


> -----Original Message-----
> From: Andy Wingo [mailto:wingo at igalia.com]
> Sent: Monday, April 29, 2013 11:56 AM
> To: Ron Buckton
> Cc: Brendan Eich; es-discuss
> Subject: Re: yield* desugaring
> 
> 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.

That's correct, it's not quite right given the fact it needs to be an expression. I've been more focused on how to rewrite this via transpiler in ES5.

> 
> 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