FunctionDeclaration as Statement note

Allen Wirfs-Brock Allen.Wirfs-Brock at
Fri Mar 13 11:58:53 PDT 2009

In reviewing the ES3.1 draft, I found an incomplete note at the end of Section 12 that was intended to explain why ES3.1 does not extent the Statement production to include FunctionDeclaration.  I have drafted a proposed final form of this note and would be interested in any feedback.

Several widely used implementations of ECMAScript are known to support the use of FunctionDeclaration as a Statement. However there are significant and irreconcilable variations among the implementations in the semantics applied to such FunctionDeclarations. Because of these irreconcilable difference, the use of a FunctionDeclaration as a Statement results in code that is not reliably portable among implementations. It is recommended that ECMAScript implementations either disallow this usage of FunctionDeclaration or issue a warning when such a usage is encountered. Future editions of ECMAScript may define alternative portable means for declaring functions in a Statement context.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Es-discuss mailing list