Conflicting declarations -- Was: Re: local

Mark S. Miller erights at google.com
Fri Aug 22 14:04:53 PDT 2008


I agree that this should be a static error.

On Fri, Aug 22, 2008 at 12:40 PM, Waldemar Horwat <waldemar at google.com> wrote:
> 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
> _______________________________________________
> Es3.x-discuss mailing list
> Es3.x-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es3.x-discuss
>



-- 
    Cheers,
    --MarkM


More information about the Es-discuss mailing list