Brandon Benvie wrote:
Unless I'm mistaken on how Spidermonkey handles function declarations in block scope, almost none of those examples will work correctly in Firefox. Most of them will work in every other major browser, but not in Firefox.

No, that's not so. The ancient (pre-ES3) SpiderMonkey function-in-block semantics are like an assignment expression in effect, so if control flow reaches the nested function declaration, the var-like binding will be *created* and initialized. If control flow does not reach one of N possible for a given name, then the var-like binding won't even exist.

Crazy but true.

The snippets Brian posted all look like they'll work in SpiderMonkey / Firefox, at a glance from me. Let me know if I missed something.

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

Reply via email to