mirror of https://github.com/tc39/test262.git
Merge pull request #1801 from mathiasbynens/issue-1634
Move `throw "…"` for negative parsing errors to a helper function
This commit is contained in:
commit
dec4e5df74
|
@ -191,18 +191,19 @@ Each test case is run in a fresh JavaScript environment; in a browser, this will
|
|||
|
||||
Function | Purpose
|
||||
---------|--------
|
||||
Test262Error(message) | constructor for an error object that indicates a test failure
|
||||
$DONE(arg) | see Writing Asynchronous Tests, below
|
||||
assert(value, message) | throw a new Test262Error instance if the specified value is not strictly equal to the JavaScript `true` value; accepts an optional string message for use in creating the error
|
||||
assert.sameValue(actual, expected, message) | throw a new Test262Error instance if the first two arguments are not [the same value](https://tc39.github.io/ecma262/#sec-samevalue); accepts an optional string message for use in creating the error
|
||||
assert.notSameValue(actual, unexpected, message) | throw a new Test262Error instance if the first two arguments are [the same value](https://tc39.github.io/ecma262/#sec-samevalue); accepts an optional string message for use in creating the error
|
||||
assert.throws(expectedErrorConstructor, fn, message) | throw a new Test262Error instance if the provided function does not throw an error, or if the constructor of the value thrown does not match the provided constructor
|
||||
$ERROR(message) | construct a Test262Error object and throw it <br>**DEPRECATED** -- Do not use in new tests. Use `assert`, `assert.*`, or `throw new Test262Error` instead.
|
||||
`Test262Error(message)` | constructor for an error object that indicates a test failure
|
||||
`$DONE(arg)` | see [Writing Asynchronous Tests](#writing-asynchronous-tests), below
|
||||
`assert(value, message)` | throw a new Test262Error instance if the specified value is not strictly equal to the JavaScript `true` value; accepts an optional string message for use in creating the error
|
||||
`assert.sameValue(actual, expected, message)` | throw a new Test262Error instance if the first two arguments are not [the same value](https://tc39.github.io/ecma262/#sec-samevalue); accepts an optional string message for use in creating the error
|
||||
`assert.notSameValue(actual, unexpected, message)` | throw a new Test262Error instance if the first two arguments are [the same value](https://tc39.github.io/ecma262/#sec-samevalue); accepts an optional string message for use in creating the error
|
||||
`assert.throws(expectedErrorConstructor, fn, message)` | throw a new Test262Error instance if the provided function does not throw an error, or if the constructor of the value thrown does not match the provided constructor
|
||||
`$DONOTEVALUATE()` | throw an exception if the code gets evaluated. This is useful for [negative test cases for parsing errors](#handling-errors-and-negative-test-cases)
|
||||
`$ERROR(message)` | construct a Test262Error object and throw it <br>**DEPRECATED** -- Do not use in new tests. Use `assert`, `assert.*`, or `throw new Test262Error` instead.
|
||||
|
||||
```
|
||||
```javascript
|
||||
/// error class
|
||||
function Test262Error(message) {
|
||||
//[omitted body]
|
||||
// [omitted body]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -217,7 +218,7 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var var = var;
|
||||
```
|
||||
|
@ -230,6 +231,8 @@ assert.throws(TypeError, function() {
|
|||
});
|
||||
```
|
||||
|
||||
Consumers that violate the spec by throwing exceptions for parsing errors at runtime instead of at parse time can still get value out of Test262's negative tests by conditionally overriding `$DONOTEVALUATE` to be a no-op for tests that are known to fail. This way, the consumer can still verify that they throw an exception of the expected type, even if it happens during the wrong phase, which prevents regressions and further deviations from the spec.
|
||||
|
||||
## Writing Asynchronous Tests
|
||||
|
||||
An asynchronous test is any test that include the `async` frontmatter flag. When executing such tests, the runner expects that the global `$DONE()` function will be called to signal test completion.
|
||||
|
|
|
@ -86,7 +86,7 @@ properties of the global scope prior to test execution.
|
|||
an Int32. This function may return before a broadcast is received
|
||||
(eg to return to an event loop to await a message) and no code should
|
||||
follow the call to this function.
|
||||
- **`report`** - a function that accepts a single "message" argument,
|
||||
- **`report`** - a function that accepts a single "message" argument,
|
||||
which is converted to a string\* and placed in a transmit queue whence the parent will retrieve it. Messages should be short. (\* Note that string conversion has been implicit since the introduction of this host API, but is now explicit.)
|
||||
- **`sleep`** - a function that takes a millisecond argument and
|
||||
sleeps the agent for approximately that duration.
|
||||
|
@ -101,7 +101,9 @@ properties of the global scope prior to test execution.
|
|||
and returns it if it exists, or returns `null` otherwise.
|
||||
- **`sleep`** - a function that takes a millisecond argument and
|
||||
sleeps the execution for approximately that duration.
|
||||
- **`monotonicNow`** - a function that returns a value that conforms to [`DOMHighResTimeStamp`][] and is produced in such a way that its semantics conform to **[Monotonic Clock][]**.
|
||||
- **`monotonicNow`** - a function that returns a value that conforms to [`DOMHighResTimeStamp`][] and is produced in such a way that its semantics conform to **[Monotonic Clock][]**.
|
||||
|
||||
In addition, consumers may choose to override any of the [the available test harness helper functions](https://github.com/tc39/test262/blob/master/CONTRIBUTING.md#test-environment) as they see fit. See [the documentation on handling errors and negative test cases](https://github.com/tc39/test262/blob/master/CONTRIBUTING.md#handling-errors-and-negative-test-cases) for a useful example of this.
|
||||
|
||||
|
||||
#### Normative references
|
||||
|
@ -174,7 +176,7 @@ These tests are expected to generate an uncaught exception. The value of this
|
|||
attribute is a YAML dictonary with two keys:
|
||||
|
||||
- `phase` - the stage of the test interpretation process that the error is
|
||||
expected to be produced; valid phases are:
|
||||
expected to be produced; valid phases are:
|
||||
- `parse`: occurs while parsing the source text.
|
||||
- `early`: occurs prior to evaluation.
|
||||
- `resolution`: occurs during module resolution.
|
||||
|
@ -203,7 +205,7 @@ negative:
|
|||
phase: parse
|
||||
type: ReferenceError
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
'litera'=1;
|
||||
```
|
||||
|
||||
|
@ -213,7 +215,7 @@ negative:
|
|||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
var a\u2E2F;
|
||||
```
|
||||
|
||||
|
@ -225,7 +227,7 @@ negative:
|
|||
type: ReferenceError
|
||||
flags: [module]
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
export {} from './instn-resolve-empty-export_FIXTURE.js';
|
||||
// instn-resolve-empty-export_FIXTURE.js contains only:
|
||||
// 0++;
|
||||
|
@ -387,10 +389,10 @@ The `locale` attribute allows tests to declare explicit information regarding lo
|
|||
/*---
|
||||
locale: [en, en-US, ar]
|
||||
---*/
|
||||
|
||||
|
||||
var en = new Intl.PluralRules('en');
|
||||
assert.sameValue(en.select(1), 'one', 'en.select(1) returns "one"');
|
||||
assert.sameValue(en.select(2), 'other', 'en.select(2) returns "other"');
|
||||
assert.sameValue(en.select(2), 'other', 'en.select(2) returns "other"');
|
||||
|
||||
var enUS = new Intl.PluralRules('en-US');
|
||||
assert.sameValue(enUS.select(1), 'one', 'enUS.select(1) returns "one"');
|
||||
|
|
|
@ -21,3 +21,7 @@ var $ERROR;
|
|||
$ERROR = function $ERROR(message) {
|
||||
throw new Test262Error(message);
|
||||
};
|
||||
|
||||
function $DONOTEVALUATE() {
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
}
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
var \u0061wait;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
var await;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
void \u0061wait;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
void await;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
\u0061wait: ;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
await: ;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
var \u0061wait;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
var await;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
void \u0061wait;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
void await;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
\u0061wait: ;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
await: ;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
var yi\u0065ld;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
var yield;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
void yi\u0065ld;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
void yield;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
yi\u0065ld: ;
|
||||
|
|
|
@ -18,6 +18,6 @@ template: syntax
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
yield: ;
|
||||
|
|
|
@ -20,7 +20,7 @@ negative:
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
return {
|
||||
...(function() {
|
||||
|
|
|
@ -13,7 +13,7 @@ negative:
|
|||
---*/
|
||||
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
//- body
|
||||
(function() {
|
||||
var yield;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x;
|
||||
|
|
|
@ -23,7 +23,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x;
|
||||
|
|
|
@ -23,7 +23,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x;
|
||||
|
|
|
@ -23,7 +23,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x;
|
||||
|
|
|
@ -29,7 +29,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x;
|
||||
|
|
|
@ -23,7 +23,7 @@ negative:
|
|||
phase: parse
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: arrow function expression
|
|||
features: [arrow-function, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
x = () => /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: computed ClassElementName
|
|||
features: [class, class-fields-public, computed-property-names]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
class C {
|
||||
|
|
|
@ -8,7 +8,7 @@ name: equality expression
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
x = {} == /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: literal ClassElementName
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: private field, arrow function expression
|
|||
features: [class, arrow-function, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x = () => /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: ClassElementName PrivateName
|
|||
features: [class, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: private field, ternary expression
|
|||
features: [class, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x = false ? {} : /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: private field, typeof expression
|
|||
features: [class, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
#x = typeof /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static computed ClassElementName
|
|||
features: [class, class-static-fields-public, computed-property-names]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
class C {
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static literal ClassElementName
|
|||
features: [class, class-static-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
static x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static PrivateName
|
|||
features: [class, class-static-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
static #x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static string literal ClassElementName
|
|||
features: [class, class-static-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
static 'x' = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: string literal ClassElementName
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
'x' = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: ternary expression
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
x = false ? {} : /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: typeof expression
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
x = typeof /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: arrow function expression
|
|||
features: [arrow-function, class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: computed ClassElementName
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
|
|
|
@ -8,7 +8,7 @@ name: equality expression
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = {} == /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: literal ClassElementName
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: private field, arrow function expression
|
|||
features: [class, arrow-function, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: ClassElementName PrivateName
|
|||
features: [class, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: private field, ternary expression
|
|||
features: [class, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = true ? {} : /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: private field, typeof expression
|
|||
features: [class, class-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = typeof /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static computed ClassElementName
|
|||
features: [class, class-static-fields-public, computed-property-names]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static literal ClassElementName
|
|||
features: [class, class-static-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static PrivateName
|
|||
features: [class, class-static-fields-private]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static #x = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: static string literal ClassElementName
|
|||
features: [class, class-static-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static 'x' = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: string literal ClassElementName
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
'x' = /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: ternary expression
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = true ? {} : /*{ initializer }*/;
|
||||
|
|
|
@ -8,7 +8,7 @@ name: typeof expression
|
|||
features: [class, class-fields-public]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = typeof /*{ initializer }*/;
|
||||
|
|
|
@ -11,7 +11,7 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C /*{ heritage }*/{
|
||||
/*{ elements }*/
|
||||
|
|
|
@ -11,7 +11,7 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class /*{ heritage }*/{
|
||||
/*{ elements }*/
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ async function f() {} /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ async function* f() {} /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ class f {} /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ const f = 0; /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ function f() {} /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [generators]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ function* f() {} /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ let f; /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ var f; /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: async function f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: async function* f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: class f {} default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: const f = 0; default: /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: function f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [generators]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: function* f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: let f; default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: var f; default: /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ async function f() {} /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ async function* f() {} /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ class f {} /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ const f = 0; /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ function f() {} /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [generators]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ function* f() {} /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ let f; /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: async function f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: async function* f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: class f {} default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: const f = 0; default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: function f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [generators]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: function* f() {} default: /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
switch (0) { case 1: let f; default: /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ async function f() {} /*{ body }*/ }
|
||||
|
|
|
@ -16,6 +16,6 @@ negative:
|
|||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ async function* f() {} /*{ body }*/ }
|
||||
|
|
|
@ -15,6 +15,6 @@ negative:
|
|||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
$DONOTEVALUATE();
|
||||
|
||||
{ class f {} /*{ body }*/ }
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue