Closed
Description
Tested with 1.8
and 1.9.0-dev.20160406
Is it intentional that the following fails to compile?
let x = 5;
{
console.log(x); // Block-scoped variable 'x' used before its declaration
let x = x; // Block-scoped variable 'x' used before its declaration
console.log(x);
}
The inner x
is effectively shadowing the outer x
, but only at and after the point it is redefined (i.e. the inner let x
)
I couldn't find any specific mention of this in #904 which appears to be the documentation for let
right now (via the spec)
Thanks