On Apr 22, 2011, at 3:34 PM, Claus Reinke wrote:
> 
> Perhaps you should have used 'catch' instead of 'with' for
> your example - the combination of 
>   - implementations allowing FunctionDeclaration as statement
>   - implementations differ in how such FunctionDeclarations        are hoisted
>   - ES/next limiting FunctionDeclaration hoisting to blocks
> 
> seems to imply that for some implementations, ES/next will
> have different behaviour than ES5+FD-statements,

Yes, that's right, but as stated it might seem to imply that implementations 
agree with one another on FD-in-block today. Current implementations do not all 
agree, so migrating will involve work and testing in any event.

For this reason, ES5 strict implemented in Firefox 4 (SpiderMonkey) makes 
FD-in-block an error:

js> function f() { "use strict"; if (C) { function D(){} } } 
typein:2: SyntaxError: in strict mode code, functions may be declared only at 
top level or immediately within another function:
typein:2: function f() { "use strict"; if (C) { function D(){} } }
typein:2: ...............................................^

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

Reply via email to