Commit Graph

35 Commits

Author SHA1 Message Date
Richard Gibson 2060494f28 Test for assignment with target wrapped in two sets of parentheses 2023-11-21 09:51:03 -05:00
Veera 88a2f0dcd1 Fix copyright 2023-05-18 11:19:31 -07:00
Veera bf337727a0 Try to fix CI errors 2023-05-18 11:19:31 -07:00
Veera 377231a1de Add tests for increment and decrement operations on `this` 2023-05-18 11:19:31 -07:00
Rick Waldron 64a4b76c62
chore: migrate $ERROR -> throw new Test262Error in test/language/e* (#3098) 2021-07-28 13:48:39 -07:00
Rick Waldron 92a200b29f Attempting to set a value to a binding that no longer exists must throw a ReferenceError exception in strict mode code. Fixes gh-427 2020-09-15 16:33:59 -04:00
Rick Waldron 8a2bfb48d4 Delete invalid tests 2020-09-15 16:33:59 -04:00
Ross Kirsling 1859ec66f4 Test update for letting all early errors be SyntaxErrors 2019-06-12 14:09:03 -04:00
Leo Balter 42a8594e56 fix files frontmatter after linting 2019-02-25 16:14:21 -05:00
André Bargull b11def3bf4 Global 'arguments' binding is not present in all runtime environments 2019-01-30 06:53:46 -08:00
Rick Waldron 1068137f00 UpdateExpressions: fix descriptions (#2051) 2019-01-25 14:39:54 -05:00
Adrian Heine 04a41383b5 UpdateExpressions: No early error for arguments and eval in non-strict mode
According to sec-identifiers-static-semantics-assignmenttargettype,
`AssignmentTargetType` of `arguments` and `eval` in non-strict mode code is
`simple`.
sec-update-expressions-static-semantics-early-errors mandates early errors for
`UpdateExpression` if `AssignmentTargetType` is `invalid` or `strict`.
2019-01-25 12:39:02 -05:00
Rick Waldron 73705f8801 UpdateExpressions: add necessary changes to tests to reflect latest specification. 2018-12-20 12:48:59 -05:00
Mathias Bynens b9daa57dcb Rename to $DONOTEVALUATE per @leobalter's suggestion 2018-10-23 13:51:17 +02:00
Mathias Bynens e3feffb01e Move `throw "…"` for negative parsing errors to a helper function
Closes #1634.
2018-10-23 13:51:16 +02:00
jugglinmike 42ed4291f5 Refactor increment/decrement tests for parsers (#1786)
The tests for the parsing of postfix increment, postfix decrement,
prefix increment, and prefix decrement were expressed using `eval`.
This made the tests more complex than necessary and also prevented the
tests from providing value to ECMAScript parsers.

Remove the use of `eval` and instead express the expectations with
literal source text.
2018-09-24 12:29:30 -04:00
Thomas Wood 2d4ac25fa0 Add feature flags for `new.target`
Additionally removed the `arrow-function` feature for
test/language/eval-code/direct/new.target-fn.js as it is not testing
arrow-functions, but they are mentioned in the preamble.
2018-07-24 20:31:35 +01:00
Mike Pennisi 136110378b Rename negative test "phase" for parsing
Early errors may result from parsing the source text of a test file, but
they may also result from parsing some other source text as referenced
through the ES2015 module syntax. The latter form of early error is not
necessarily detectable by ECMAScript parsers, however. Because of this,
the label "early" is not sufficiently precise for all Test262 consumers
to correctly interpret all tests.

Update the "phase" name of "early" to "parse" for all those negative
tests that describe errors resulting from parsing of the file's source
text directly. A forthcoming commit will update the remaining tests to
use a "phase" name that is more specific to module resolution.
2018-01-05 15:17:50 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Josh Wolfe a88b08f3fe Increment/decrement tests for references to BigInt values (#1261) 2017-10-04 11:55:24 -04:00
Mike Pennisi 81d00def42 Force "early error" tests to fail if evaluated
This pattern makes expectations more explicit by making test files more
literal.
2017-06-28 11:24:36 -04:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Mike Pennisi d5a3a962b2 Reformat negative ReferenceError tests 2016-10-19 15:24:18 -04:00
Mike Pennisi 24e774251a Test runtime errors with assertion utility method
Improve test consistency by using the `assert.throws` helper function to
assert runtime exceptions. Remove superfluous code.
2016-10-18 14:36:14 -04:00
jugglinmike ab4ff914fb Add tests for assignment target validation of new ES2015 forms (#693)
This re-factors some existing Sputnik tests to be more targeted and to use a
pattern that can be generalized to other forms. We could test these all day,
but I've limited myself to forms introduced in ES2015, specifically
YieldExpression and new.target. Note that SpiderMonkey incorrectly throws a
SyntaxError for these.
I thoughtlessly wrote ReferenceError tests for yield = 1 until I realized
that such productions are not actually recognized by the grammar, so the early
errors do not apply. Instead, I've added a negative syntax test for that case.

* Refactor test for valid cover

* Add tests for ValidSimpleAssignmentTarget

Ensure that constructs introduced in ES2015 are disallowed as assignment
targets, with or without a "cover" grammar.

* Add test for grammar precedence of YieldExpression
2016-07-05 15:20:56 -07:00
Mike Pennisi eb644bb2da Reduce reliance on `fnGlobalObject.js`
This harness function is not necessary in the majority of cases in which
it is used. Remove its usage to simplify tests and decrease the amount
of domain-specific knowledge necessary to contribute to the test suite.

Persist the harness function itself for use by future tests for ES2015
modules (such a helper is necessary for tests that are interpreted as
module code).
2016-04-25 11:09:21 -07:00
André Bargull 73d5292b77 Replace runTestCase with assert helpers [test/language/expressions] 2015-08-13 17:34:17 +02:00
André Bargull 3de484fe83 Replace runTestCase with assert.throws [test/language/expressions] 2015-08-11 17:42:41 +02:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
Mike Pennisi 64826c2ad3 Make tests more strict
In ECMAScript 5, assignment to a non-reference value throws a runtime
ReferenceError. ECMAscript 6 specifies an early ReferenceError in these
cases. Tests for this behavior have been authored to pass in both cases.
Simplify these tests to describe and assert the early error.
2015-06-29 12:25:01 -04:00
Mike Pennisi 29ecced632 Update handling of directive prologues
Some tests specifically concern the application of the `use strict`
directive as it appears in JavaScript source code. These tests should
*not* be run with the `onlyStrict` flag because relying on the test
runner to enable strict mode makes the semantics of the source code
irrelevant. Update these tests to use the `noStrict` flag.

Other tests concern language semantics that are only valid in strict
mode, but the mechanism for enabling strictness is inconseqential.
Update these tests to use the `onlyStrict` flag and remove any redundant
`use strict` directive prologues contained within.

Still other tests are valid both within and outside of strict mode.
In keeping with the majority of other tests, do not specify any
restrictions on the environments in which these tests may be run.
2015-06-18 17:38:34 -04:00
André Bargull c1e1c56dc0 Increment/Decrement with property accessor expression
The increment/decrement operator evaluates its operand expression once. When
the operand expression is a property accessor, RequireObjectCoercible
and ToPropertyKey are called on the property accessor in the correct order.
2015-05-19 17:46:34 +02:00
Rick Waldron cda3ec74a1 ES6-specific tests: es5id=>es6id, new es6id entries. Closes gh-144 2015-02-12 16:36:13 -05:00
André Bargull 0ceb428ec9 Add test coverage for identifier resolution in dynamic scopes
Identifier resolution in dynamic scope context is missing test coverage, resolves https://bugs.ecmascript.org/show_bug.cgi?id=1751 .
2014-12-10 16:05:32 -08:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00