yield* desugaring

Brendan Eich brendan at mozilla.com
Mon Apr 29 09:48:17 PDT 2013


Just a straw-spec device, not proposed for ES6 or 7.

/be

Andy Wingo wrote:
> 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
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list