>> On Nov 28, 2013, at 9:51 AM, Boris Zbarsky <[email protected]> wrote:
>> 
>> On 11/28/13 11:41 AM, Filip Pizlo wrote:
>> Here's why var is good enough provided that you do the "var debug = false" 
>> thing at the top of the function:
> 
> I would think it would be done at window scope, or in some module scope, not 
> at the top of every function, no?

Yes. 

As I pointed out later in that mail, having such an implicit constant defined 
in an outer function and used in a nested function should be fine but some 
engines may not optimize it yet. And I suggested that if you find examples of 
this not working right you should file bugs against the engines. 

But it turns out that if it's done at global scope then constant-inferring the 
variable is even easier than if it was local, so that kind of idiom definitely 
shouldn't require language help. 

-Filip

> 
> -Boris
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to