do-while grammar

Mark S. Miller erights at
Tue Feb 8 14:01:02 PST 2011

Does anyone know of any other syntax that all major JS engines accept that
are not in the official ES5.1 grammar?

Does anyone know of any places on the web attempting to accumulate such

The other one I know of is nested named function declarations <>.
And there was an ASI mis-description for "break" and "continue" that was
corrected between ES5 and ES5.1.

We really need a complete codification of the consensus ES5.1 grammar.
Starting from the official grammar, the Caja <{%3b}%20while%28false%29%20false>
ES-Lab <>
parsers both reject "do {;} while (false) false;" because we didn't know any
better. I expect there are many other independent parsers (minimizers,
linters, etc) that make the same mistake.

Even if such "corrections" do not make it into future errata, I would like
to see them recorded on the ecmascript wiki.

On Tue, Feb 8, 2011 at 12:12 PM, André Bargull <andre.bargull at>wrote:

>  Just for the record, here's a link to the bug report on bugzilla
> concerning ASI for do-while:
> (Interesting that I came across the very same issue in January while
> working on the OpenLaszlo parser code :-)
> FWIW, JavaScriptCore provides automatic semicolon insertion after all
> do-while statements in all contexts. We made this change for web
> compatibility, mimicking a Firefox quirk.
>  Geoff
> On Feb 8, 2011, at 11:53 AM, Dave Fugate wrote:
>   Just to confirm, do-while iteration statements do in fact require a
> semi-colon at the end as indicated in 12.6.1 of ES5, correct?  That is, a
> production of the nature:
>                 do {;} while (false) *false*;
> would be invalid JavaScript as doesn’t meet any of the three rules set out
> in 7.9.1,  right?
> Thanks,
> Dave
> _______________________________________________
> es-discuss mailing list
> es-discuss at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list