| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/class-fields/propname-constructor.case |
| 3 |
// - src/class-fields/propname-error/cls-expr-literal-name.template |
| 4 |
/*--- |
| 5 |
description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) |
| 6 |
esid: sec-class-definitions-static-semantics-early-errors |
| 7 |
features: [class, class-fields-public] |
| 8 |
flags: [generated] |
| 9 |
negative: |
| 10 |
phase: parse |
| 11 |
type: SyntaxError |
| 12 |
info: | |
| 13 |
Static Semantics: PropName |
| 14 |
LiteralPropertyName : IdentifierName |
| 15 |
Return StringValue of IdentifierName. |
| 16 |
|
| 17 |
|
| 18 |
// This test file tests the following early error: |
| 19 |
Static Semantics: Early Errors |
| 20 |
|
| 21 |
ClassElement : FieldDefinition; |
| 22 |
It is a Syntax Error if PropName of FieldDefinition is "constructor". |
| 23 |
|
| 24 |
---*/ |
| 25 |
|
| 26 |
|
| 27 |
throw "Test262: This statement should not be evaluated."; |
| 28 |
|
| 29 |
var C = class { |
| 30 |
constructor; |
| 31 |
}; |