Newly revised Section 10 for ES3.1.
brendan at mozilla.org
Wed Jul 9 19:00:10 PDT 2008
On Jul 9, 2008, at 6:54 PM, Mark S. Miller wrote:
> On Wed, Jul 9, 2008 at 6:47 PM, Mike Shaver <mike.shaver at gmail.com>
> 2008/7/9 Maciej Stachowiak <mjs at apple.com>:
> > > Although the standard does not allow block-level function
> > 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
• 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
More information about the Es4-discuss