January 19 meeting notes

Brendan Eich brendan at mozilla.org
Fri Jan 20 10:22:47 PST 2012

> Mark S. Miller <mailto:erights at google.com>
> January 20, 2012 10:15 AM
> On Fri, Jan 20, 2012 at 9:57 AM, Herby Vojčík <herby at mailbox.sk 
> <mailto:herby at mailbox.sk>> wrote:
>     "Single scope, args are lets" view is making sense of this. Ok,
>     thanks.
> Another case together with this one seems to force us into "Single 
> scope, args are vars":
>     function foo(e) { var e ... }
> The "var e" is currently accepted in both strict and non-strict as a 
> redundant declaration of the same variable, no shadowing or error. We 
> can't break this. And we can't explain it if params are "let" bindings.

Exactly -- sorry I didn't raise this yesterday. Allen, IIRC we've 
discussed it. This was the reason ES4 equated let and var at top of 
function body or Program production (but that was in the bad old days).
> If it turns out to be practically backwards compatible, we would like 
> to explain "} catch (e) {" as a let binding of "e",

ES5 doesn't include "let" but essentially specifies this, and engines do 
it (those that support 'let' use exactly the same machinery).

> leading to a simpler explanation of its block-local scope. The hard 
> case is
>   } catch (e) { var e ... }
> which would have to become an error. We don't yet know if this new 
> breakage would create actual problems in practice.

Pretty sure we can break this. We should.


More information about the es-discuss mailing list