test262/test/language/statements/class/elements/fields-literal-name-propnam...

30 lines
784 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 IdentifierName 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
LiteralPropertyName : IdentifierName
Return StringValue of IdentifierName.
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
}