The `negative` frontmatter tag expresses an expectation for the behavior
of the test file as a whole. The `assert.throws` helper function offers
more fine-grained control over expectations because it may be applied to
specific statements and expressions. This makes it preferable in cases
where it may be used (i.e. when the test body does not describe a syntax
error or early error).
Re-implement assertions for errors to use the `assert.throws` helper
function wherever possible.
Test262 maintains most tests for the FunctionPrototype intrinsic within
the `test/built-ins/Function/prototype/` directory. Two tests are
defined within the otherwise-empty `test/built-ins/intrinsics/`
directory; relocate them to the canonical directory for consistency and
discoverability.
The `test/language/class/` directory contains a small subset of
Test262's tests for ES2015 classes. The majority of tests for classes
are organized within `test/language/statements/class/`.
- Move the tests that rely on the ClassDeclaration syntactic form from
`test/language/class/` to `test/language/statements/class/`.
- Move the test that relies on the ClassExpression syntactic form from
`test/language/class/` to `test/language/expressions/class/`.
- Re-organize existing tests for identifiers
Name files according to their content (not their ES5 ID). Move tests
for IdentifierName and LabelIdentifier to more appropriate directories.
- Simplify and correct tests
Instead of asserting successful runtime evaluation using `eval`, rely
on the test runner's ability to detect syntax errors. Update the test
bodies to test the grammar referenced by their ES5 ID and
description--the IdentifierStart pattern.
- Use `negative` frontmatter to assert SyntaxErrors
- Remove redundant tests
- Use `assert.equal` helper function
- Add equivalent tests for literal unicode chars
- Add tests for variable-length unicode escape
The `test/language/generators/` directory contained a single file that
concerned generators derived both from syntactic form and from a
built-in function.
Refactor this test into two files and place each in the appropriate
directory.
- 15.10.2.15-3-1 and 15.10.2.15-3-2 are both invalid (U+002F (SOLIDUS) instead of U+005C (REVERSE SOLIDUS) was used to start an escape sequence).
- 15.10.4.1-2 and 15.10.2.2-1 are identical tests, delete the latter.
- Update tests to avoid using runTestCase() function.
- Update multiple test infos to point to correct algorithm step (CharacterRange step 6 instead of step 1).
Uniformly and exhaustively test the generic aspects of the static- and
instance Promise methods, including:
- function `length` properties
- function `name` properties
- method property descriptors
Some tests involving the directive prologue are invalidated by source
text transformations that insert executable code in the beginning of the
script. Implement a `raw` flag that allows these tests to opt-out of
this transformation. Update the relevant tests to use this flag (and
remove references to globals only available when code is injected).
Update the Python runner accordingly:
- Do not run tests marked as "raw" in strict mode
- Reject invalid test configurations
Update the browser runner accordingly:
- Do not modify the script body of tests marked as "raw"
Including:
- 21.2.4.2 get RegExp [ @@species ]
- 21.2.5.3 get RegExp.prototype.flags
- 21.2.5.4 get RegExp.prototype.global
- 21.2.5.5 get RegExp.prototype.ignoreCase
- 21.2.5.7 get RegExp.prototype.multiline
- 21.2.5.10 get RegExp.prototype.source
- 21.2.5.12 get RegExp.prototype.sticky
- 21.2.5.15 get RegExp.prototype.unicode
- 22.1.2.5 get Array [ @@species ]
- 23.1.2.2 get Map [ @@species ]
- 23.2.2.2 get Set [ @@species ]
- 24.1.3.3 get ArrayBuffer [ @@species ]
- 24.1.4.1 get ArrayBuffer.prototype.byteLength
- 24.2.4.1 get DataView.prototype.buffer
- 24.2.4.2 get DataView.prototype.byteLength
- 24.2.4.3 get DataView.prototype.byteOffset
- 25.4.4.6 get Promise [ @@species ]
- B.2.2.1.1 get Object.prototype.__proto__
- B.2.2.1.2 set Object.prototype.__proto__
Skipped TypedArray tests in order to avoid an early test strategy definition for them.