This change set includes tests for most invocations of the
SetFunctionName abstract operation in the ES2015 specification.
Practical testing considerations preclude the introduction of tests for
certain invocations:
- The project is still vetting methods to sustainably test the semantics
of the Destructuring Binding pattern across all valid productions.
- 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
- 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
- Without a loader, there is no way to access a function object declared
in an ExportDeclaration, so `name` assignment cannot be tested in
these cases
- 14.1.19 Runtime Semantics: InstantiateFunctionObject
- 14.4.12 Runtime Semantics: InstantiateFunctionObject
- 14.5.15 Runtime Semantics: BindingClassDeclarationEvaluation
- 15.2.3.11 Runtime Semantics: Evaluation
- Add missing 'negative: ReferenceError' in S7.9_A5.7_T1
- Remove stale 'negative: ReferenceError' in block-local-closure-get-before-initialization
- Remove all tail-call expressions in test/built-ins/Function
- And update code in test/built-ins/Function to simply use 'f()' instead of 'var r = f(); return r'
Fixes#383
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.