do-while grammar

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Feb 8 14:41:43 PST 2011


see below
On Feb 8, 2011, at 2:01 PM, Mark S. Miller wrote:

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

Yes, various RegExp syntax discrepancies are know to exist.  Somebody needs to catalog them.

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

None that I know of that I would unconditionally trust.


> 
> The other one I know of is nested named function declarations <http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls>. And there was an ASI mis-description for "break" and "continue" that was corrected between ES5 and ES5.1.

There really isn't any useful common semantics for function declaration in blocks.  See https://blogs.msdn.com/b/ie/archive/2010/08/25/chakra-interoperability-means-more-than-just-standards.aspx 


> 
> We really need a complete codification of the consensus ES5.1 grammar. Starting from the official grammar, the Caja <http://caja.appspot.com/trycaja/index.html?input=do%20{%3b}%20while%28false%29%20false> and ES-Lab <http://es-lab.googlecode.com/svn/trunk/site/esparser/index.html> 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.

I was going to suggest that the place to start is bugs.ecmascript.org, but you beat me to it.

Allen



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110208/595d73b2/attachment-0001.html>


More information about the es-discuss mailing list