On Mon, Sep 10, 2012 at 2:59 PM, Tobie Langel <[email protected]> wrote: > On Sep 10, 2012, at 9:48 PM, Jason Orendorff <[email protected]> > wrote: > >> On Mon, Sep 10, 2012 at 12:50 PM, Kevin Smith <[email protected]> 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? > > In their lexical scope.
This isn't a complete answer. As it stands, the lexical scope of arguments is the same as the scope of everything else in the function body. Which leaves us with exactly what I was saying earlier. -j _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

