Generator issue: exceptions while initializing arguments
Jason Orendorff
jason.orendorff at gmail.com
Mon Sep 10 12:47:58 PDT 2012
On Mon, Sep 10, 2012 at 12:50 PM, Kevin Smith <khs4473 at gmail.com> wrote:
>> > function f(x=EXPR1, y=EXPR2) { BODY }
>> > ===>
>> > function f(x, y) {
>> > if (x === void 0) x = EXPR1;
>> > if (y === void 0) y = EXPR2;
>> > BODY
>> > }
>
> I'm not so sure - the desugaring above would mean that default expressions
> would have visibility across curly-brace boundaries, which I find to be
> quite surprising.
It is surprising. It could even bite unwary programmers. But in what
scope do you propose to evaluate default-param expressions?
-j
More information about the es-discuss
mailing list