On Jun 4, 2014, at 2:43 PM, John Lenz <concavel...@gmail.com> wrote:

> 
> 
> 
> 
> 
> How does someone write code to make sure it doesn't fall into legacy 
> semantics?  Unless, I misunderstand these rules seem like a refactoring 
> hazard.  It would seem better to say: sloppy mode === no block scoped 
> function declarations.  strict mode === block scoped function declarations.

We don’t want to leave the meaning of function declarations in blocks 
completely unspecified, as in ES1-5 as we; know there are legacy compatibility 
requirements for them.  So, we need to have some semantics for them.  The 
easiest way to provide any semantics is to simply use the  same  block scoping 
semantics that is used in strict mode (slight augmented to  over the legacy 
intersection semantics).  That actually limits the refactoring hazard because 
as long as you have no code that depends upon the legacy intersection there is 
no difference between the function in block strict and sloppy semantics.  

Allen
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to