On Jul 9, 2008, at 6:54 PM, Mark S. Miller wrote: > On Wed, Jul 9, 2008 at 6:47 PM, Mike Shaver <[EMAIL PROTECTED]> > wrote: > 2008/7/9 Maciej Stachowiak <[EMAIL PROTECTED]>: > > > Although the standard does not allow block-level function > declarations > > > I'd understood that, while ES3 didn't specify such declarations, it > > was not a violation of the standard to have them. I agree with your > > assessment of the compatibility impact, certainly. > > I believe the prohibition is in the ES3 syntax definition.
ES3 chapter 16: An implementation shall report all errors as specified, except for the following: • An implementation may extend program and regular expression syntax. To permit this, all operations (such as calling eval, using a regular expression literal, or using the Function or RegExp constructor) that are allowed to throw SyntaxError are permitted to exhibit implementation-defined behaviour instead of throwing SyntaxError when they encounter an implementation-defined extension to the program or regular expression syntax. As Maciej notes, all four browsers extend syntax to support functions in sub-statement contexts. There's no prohibition given the chapter 16 language allowing such extensions. Is ES3.1 specifying "reality" (intersection semantics), or something not in the intersection or union of existing browsers' syntax and semantics, that is restrictive and therefore not compatible without a similar allowance for extensions? Chapter 16 is important to carry forward in any 3.1 or 4 successor edition. /be _______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
