I'm with Jeff on this one. I'm very much against special casing add-on code -- 
which will invariably develop into another compatibility to break when we 
finally do decide to break it.

----- Original Message -----
From: "Jeff Walden" <jwalden+...@mit.edu>
To: dev-platform@lists.mozilla.org
Sent: Friday, September 19, 2014 5:51:38 PM
Subject: Re: ES6 lexical temporal dead zone has landed on central

On 09/18/2014 04:18 PM, Kent James wrote:
> Substituting var for let does not result in code that behaves identically to 
> previous code, so I can't see why that would be proposed.

The proposal would be to perform the substitution only for let at "body level" 
of a function.  (And for global let -- which requires its own semantic changes, 
see bug 589199, that are in progress but not complete yet.)  So this:

let s = "valid";
{ let s = "invalid";}
dump(s);

would be converted to this:

var s = "valid";
{ let s = "invalid";}
dump(s);

with no semantic change.

This substitution is absolutely not a good idea in the long run.  In the short 
run, for a release or two...maybe.  But that's a veeeery hesitant maybe.  I'm 
leery of introducing these deviations into the language, such that people write 
code expecting the standard semantics and are surprised to find the code 
doesn't work as expected in other contexts.  How should addons that inject code 
into pages behave, for that code?  Is this something that an addon author could 
easily predict?  I could well imagine it working either way.  I'd really rather 
not go down this path if we can help it.

Jeff
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to