do-while grammar

Dave Fugate dfugate at
Wed Feb 23 19:14:31 PST 2011

*better late than never:)*

It's a bit hard to digest, but I'm slowly accumulating this info in the form of disabled Test262 tests<> and bugs.  Wouldn't take too much effort to turn this into something a bit more readable on the Wiki.  Aside from the bugs already filed and what's been mentioned in this thread, there's a couple more I can think of offhand:

-          "\X12" (versus "\x12")

-          "\U0001" (versus "\u0001")

My best,


From: Mark S. Miller [mailto:erights at]
Sent: Tuesday, February 08, 2011 2:01 PM
To: andre.bargull at
Cc: ggaren at; Dave Fugate; es-discuss
Subject: Re: do-while grammar

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 exceptions?

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<>> and 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<mailto: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.


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?



es-discuss mailing list
es-discuss at<mailto:es-discuss at>

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

More information about the es-discuss mailing list