On Sep 13, 2013, at 11:09 AM, Andreas Rossberg <[email protected]> wrote:
>
> OK, I assumed you were talking about TDZ in general, and not just for
> the specific case of parameter lists. For parameter lists, I agree
> that there is no reason to treat them as mutually recursive. However,
> if scoping of bindings is supposed to be sequential, but each default
> expression shall see the previous parameters, then the only clean
> solution is to conceptually have each parameter open a new nested
> scope (like is the case in some other languages). That solves your
> 'eval' case as well. I'd be happy with that, but I remember concerns
> about more fine-grained scoping on the committee.
Introducing a new scope for each argument could be extraordinarily expensive,
also would make some semantics weird:
function f(a=1, b=function(){return a}) {
var a = 2;
return b() // What's this?
}
if we say sequential scoping it becomes inconsistent for b to return 1, but the
parameter shadowing of var means that it should.
--Oliver
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss