Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/fields-string-name-propname-constructor.js

raw
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-string-name.template
4 /*---
5 description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral 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 ...
15 LiteralPropertyName : StringLiteral
16 Return the String value whose code units are the SV of the StringLiteral.
17
18
19 // This test file tests the following early error:
20 Static Semantics: Early Errors
21
22 ClassElement : FieldDefinition;
23 It is a Syntax Error if PropName of FieldDefinition is "constructor".
24
25 ---*/
26
27
28 throw "Test262: This statement should not be evaluated.";
29
30 var C = class {
31 'constructor';
32 };