January 19 meeting notes

Andreas Rossberg rossberg at google.com
Fri Jan 20 10:19:40 PST 2012


On 20 January 2012 18:28, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
>
> On Jan 20, 2012, at 7:13 AM, Wes Garland wrote:
>
> On 20 January 2012 09:22, Herby Vojčík <herby at mailbox.sk> wrote:
>>
>>
>> +1. I see no point why let e; should not shadow argument e here.
>
>
> I do.  It is a virtual certainty that this form was used accidentally by the
> developer, which indicates a flaw in the developer's thinking -- probably
> due to cut-paste/refactor code having a variable name collision.  It should
> be an early error/warning, just like it is in C.
>
> This was essentially the conclusion that was reached when this was discussed
> at the Nov. TC39 meeting.

How is

  function(x) { let x }

any different in this respect from

  { let x { let x } }

? The same argument can be made in either case. The latter is allowed,
the former isn't. In both cases, a block-local let shadows a variable
from outer scope.

/Andreas


More information about the es-discuss mailing list