Brendan Eich wrote:
> On Aug 22, 2008, at 7:26 AM, Ingvar von Schoultz wrote:
> 
>> Brendan Eich wrote:
>>> More helpful would be comments on the utility of let blocks  
>>> (a.k.a. let statements) and let expressions.
>> While reading up on this, I noticed that you can declare the
>> same name with both let and var in the same scope:
>>
>>     var x = 'global';
>>     let x = 42;
> 
> If these are both within an explicit block, the let will shadow the  
> hoisted var.

This one is bizarre and infrequent enough that I wouldn't mind if we made this 
into an error -- specifically, you can't write "var x" inside a block that 
contains a "let x" if that var would hoist to or beyond that let's block.

    Waldemar
_______________________________________________
Es-discuss mailing list
Es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to