Continuing woes in reading the ES6 spec language

Oliver Hunt oliver at apple.com
Fri Sep 13 11:17:10 PDT 2013


On Sep 13, 2013, at 11:09 AM, Andreas Rossberg <rossberg at google.com> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130913/f6f7c0f5/attachment.html>


More information about the es-discuss mailing list