archives

« Bugzilla Issues Index

#80 — Disable negative parser early error test cases violating the extension clause of Chapter 16


We have a number of tests which explicitly check to ensure a SyntaxError is thrown when specific parser extensions are present. E.g., "\1". ES5.1 actually allows this type of scenario via the JavaScript syntax extension clause found in Chapter 16:
An implementation may extend program syntax and regular expression pattern
or flag syntax. To permit this, all operations (such as calling eval, using a
regular expression literal, or using the Function or RegExp constructor) that
are allowed to throw SyntaxError are permitted to exhibit
implementation-defined behaviour instead of throwing SyntaxError when they
encounter an implementation-defined extension to the program syntax or regular
expression pattern or flag syntax.

After consulting with the TC-39 committee, we've decided 'negative parser
tests' should be disabled unless ES5.1 explicitly calls out that
they should throw. E.g., literal octals in strings under Strict Mode would be
a valid negative test case we would not disable. Literal octals in strings outside of Strict Mode would *not* be a valid negative test case.

In the long term, the test harness and website will be adapted to allow opting-in WRT running these invalid albeit useful tests.


Disabling these is trivial; identifying them...not-so-much. Three days to implement this?


All tests identified by this Work Item and in test\config\excludelist.xml have been removed by Mark. Any other invalid tests will be removed on an as-needed basis.