yield* desugaring

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


Hi again,

On Mon 29 Apr 2013 17:37, Andy Wingo <wingo at igalia.com> writes:

>   let (g = EXPR) {
>     let received = void 0, send = true;
>     while (true) {
>       let next = send ? g.send(received) : g.throw(received);
>       if (next.done)
>         break;
>       try {
>         received = yield next.value;  // ***
>         send = true;
>       } catch (e) {
>         received = e;
>         send = false;
>       }
>     }    
>     next.value;
>   }

Beyond the scoping error of "next", this desugaring uses let
expressions, which AFAICS are not in the spec and have not been
discussed in a few years.  Are they actually still a thing?

Andy


More information about the es-discuss mailing list