2018-07-31 00:35:07 +02:00
|
|
|
// 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)
|
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:
|
2017-12-03 06:06:42 +01:00
|
|
|
phase: parse
|
2017-10-21 02:39:24 +02:00
|
|
|
type: SyntaxError
|
|
|
|
info: |
|
|
|
|
Static Semantics: PropName
|
|
|
|
LiteralPropertyName : IdentifierName
|
|
|
|
Return StringValue of IdentifierName.
|
|
|
|
|
2018-07-31 00:35:07 +02:00
|
|
|
|
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".
|
|
|
|
|
|
|
|
---*/
|
|
|
|
|
|
|
|
|
|
|
|
throw "Test262: This statement should not be evaluated.";
|
|
|
|
|
|
|
|
var C = class {
|
2017-11-10 21:06:00 +01:00
|
|
|
constructor;
|
|
|
|
};
|