DaveC: > I think it worth a further nod wrt function statements inside of a > block statement.
I agree. My example was to show how can FunctionStatement can be confused with FunctionDeclaration and that lead more confusion in the reader. > ECMAScript allows syntactic extensions, one such extension is to allow > function statements inside of a block statement currently Mozilla is > the only vendor (*I think*) that has added this extension - While this is syntax extension, by my observations I think all major implementation support it, otherwise they must throw a SyntaxError. FunctionStatement syntactically is exactly as FunctionDeclaration. The main difference is that FunctionDeclration cannot appear in Statements, while FS can. You talk about it the semantic of FunctionStatement. While this is not defined by ECMA-262 standard, interpretation of FS is implementation depended. IMHO Mozilla implementation is proper at least because this FunctionStatement. > so I would > advise against it's use as the behaviour it will inconsistent across > browsers. > > See this explanation on clj http://bit.ly/eu5rqw Absolutely agree. And your test case proves your advice. -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
