2017-10-21 02:39:24 +02:00
|
|
|
// This file was procedurally generated from the following sources:
|
|
|
|
// - src/class-fields/propname-constructor.case
|
|
|
|
// - src/class-fields/propname-error/cls-decl-string-name.template
|
|
|
|
/*---
|
2017-10-31 19:49:00 +01:00
|
|
|
description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value)
|
2017-10-21 02:39:24 +02:00
|
|
|
esid: sec-class-definitions-static-semantics-early-errors
|
2017-11-28 18:49:12 +01:00
|
|
|
features: [class, class-fields-public]
|
2017-10-21 02:39:24 +02:00
|
|
|
flags: [generated]
|
|
|
|
negative:
|
2017-12-03 06:06:42 +01:00
|
|
|
phase: parse
|
2017-10-21 02:39:24 +02:00
|
|
|
type: SyntaxError
|
|
|
|
info: |
|
|
|
|
Static Semantics: PropName
|
|
|
|
...
|
2017-10-31 19:49:00 +01:00
|
|
|
LiteralPropertyName : StringLiteral
|
2017-10-21 02:39:24 +02:00
|
|
|
Return the String value whose code units are the SV of the StringLiteral.
|
|
|
|
|
|
|
|
|
|
|
|
// This test file tests the following early error:
|
|
|
|
Static Semantics: Early Errors
|
|
|
|
|
|
|
|
ClassElement : FieldDefinition;
|
|
|
|
It is a Syntax Error if PropName of FieldDefinition is "constructor".
|
|
|
|
|
|
|
|
---*/
|
|
|
|
|
|
|
|
|
|
|
|
throw "Test262: This statement should not be evaluated.";
|
|
|
|
|
|
|
|
class C {
|
2017-11-10 21:06:00 +01:00
|
|
|
'constructor';
|
2017-10-21 02:39:24 +02:00
|
|
|
}
|