Block scoping and redeclarations

Brendan Eich brendan at
Fri Aug 26 14:00:42 PDT 2011

On Aug 25, 2011, at 11:54 PM, Andreas Rossberg wrote:

> Well, in that case you would not capture the order-independence
> properly. Consider e.g.:
>  { { var x; ... let x} }
> Neither is the var hoisted "across" the source position of the let,
> nor "across" its scope. Still it's supposed to be an error.

Right, I should have seen that one coming -- but again, my prose in brief messages is not the spec.

Good news is that Allen is writing the spec.

> I'm not being entirely academic here. It's exactly details like this
> that crop up when you try to implement (and, presumably, specify)
> those rules, and they require some ugliness if you want to resolve
> everything in one pass.

There's no easy way to do var and function hoisting in one pass already, AFAICS.


More information about the es-discuss mailing list