« Bugzilla Issues Index

#7 — S7.9_A9_T3.js and S7.9_A9_T4.js are invalid as per ES5

Test262 tests S7.9_A9_T3.js and S7.9_A9_T3.js boil down to the following snippet:
do {;} while (false) false

Section 12.6.1 of ES5 states that all do-while statements should end with a semicolon. That said, section 7.9.1 allows for automatic semicolon insertion under three circumstances:
1. if the offending token (i.e., the last 'false' in the snippet above) is preceded by a newline. This is not the case
2. if the semicolon would be needed at the end of the program. Appending a semicolon to the final 'false' does not fix the snippet's grammar issue with respect to 12.6.1
3. if the grammar production is restricted. This is not the case for do-while

For the short term, I'll disable these on Test262 as they do not conform to the spec. For the long term I'd suggest:
1. We rewrite this test such that there's a newline between "(false) " and "false" thereby making it valid.
2. The original be moved elsewhere as it is validating existing Chrome behavior

As the see-also links make clear, it'snot just existing Chrome behavior -- all browsers going back to Netscape 2 did this.


Tests still exist in Sputnik. Looks like these are intended to remain disabled until ES6 is released and changes the spec in this regard.

Not sure if this will be changed for ES6 after all. Moved these into the bestPractices directory.