« Bugzilla Issues Index

#215 — has SyntaxError in ECMA262 5.1 grammer

Created attachment 4
patch for

chapter15/15.9/15.9.5/ has SyntaxError in ECMA262 5.1 grammer.

The point at issue is NumericLiteral `09`.

This is not OctalIntegerLiteral because 9 is not OctalDigit.
OctalIntegerLiteral ::
0 OctalDigit
OctalIntegerLiteral OctalDigit

And, at the same time, this is not DecimalIntegerLiteral.

DecimalIntegerLiteral ::
NonZeroDigit DecimalDigitsopt

so, parser should reduce it as 0 and 9.
And because of "The source character immediately following a NumericLiteral must not be an IdentifierStart or DecimalDigit.", this should be treated as SyntaxError.
(section 7.8.3 NOTE)

Created attachment 5
new test case for this issue

And I suggests adding new testcase for it.
This testcase file format may be invalid... sorry.

Thank you Yusuke! Very good spot, and I'll fix it shortly.

Checked into Hg.