test262/test/language/statements/class/elements/fields-string-name-propname...

31 lines
828 B
JavaScript
Raw Normal View History

// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
2017-10-21 02:39:24 +02:00
/*---
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
negative:
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.
2017-10-21 02:39:24 +02:00
// 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".
---*/
$DONOTEVALUATE();
2017-10-21 02:39:24 +02:00
class C {
'constructor';
2017-10-21 02:39:24 +02:00
}