test262/test/language/statements/class/fields-ternary-init-err-con...

35 lines
1.0 KiB
JavaScript
Raw Normal View History

2017-10-17 23:51:13 +02:00
// This file was procedurally generated from the following sources:
2017-10-18 22:23:20 +02:00
// - src/class-fields/init-err-contains-arguments.case
2017-10-17 23:51:13 +02:00
// - src/class-fields/initializer-error/cls-decl-fields-ternary.template
/*---
description: Syntax error if `arguments` used in class field (ternary expression)
esid: sec-class-definitions-static-semantics-early-errors
2017-11-28 18:49:12 +01:00
features: [class, class-fields-public]
2017-10-17 23:51:13 +02:00
flags: [generated]
negative:
phase: parse
2017-10-17 23:51:13 +02:00
type: SyntaxError
info: |
Static Semantics: Early Errors
FieldDefinition:
PropertyNameInitializeropt
- It is a Syntax Error if ContainsArguments of Initializer is true.
Static Semantics: ContainsArguments
IdentifierReference : Identifier
1. If the StringValue of Identifier is "arguments", return true.
...
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
---*/
throw "Test262: This statement should not be evaluated.";
class C {
x = false ? {} : arguments;
}