Generator issue: exceptions while initializing arguments

Jason Orendorff jason.orendorff at gmail.com
Sun Sep 9 18:52:02 PDT 2012


On Sun, Sep 9, 2012 at 8:50 PM, Jason Orendorff
<jason.orendorff at gmail.com> wrote:
> What I think is that default parameters should be specified to be as
> much like the following desugaring as possible:
>
>     function f(x=EXPR1, y=EXPR2) { BODY }
>     ===>
>     function f(x, y) {
>         if (x === void 0) x = EXPR1;
>         if (y === void 0) y = EXPR2;
>         BODY
>     }

In case it isn't clear what I'm saying here, I think the same
desugaring should hold for generators. Exceptions would then be
deferred to "loc 2" in Allen's example.


More information about the es-discuss mailing list