mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 15:34:29 +02:00
classfields: add tests for forbidden propertynames
# Conflicts: # src/class-fields/propname-constructor.case # src/class-fields/propname-error/cls-decl-computed-name.template # src/class-fields/propname-error/cls-decl-literal-name.template # src/class-fields/propname-error/cls-decl-string-name.template # src/class-fields/propname-error/cls-expr-computed-name.template # src/class-fields/propname-error/cls-expr-literal-name.template # src/class-fields/propname-error/cls-expr-string-name.template
This commit is contained in:
parent
2488cb99b3
commit
ea643db26f
20
src/class-fields/static-propname-constructor.case
Normal file
20
src/class-fields/static-propname-constructor.case
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: Static class field cannot have PropName 'constructor'
|
||||||
|
info: |
|
||||||
|
|
||||||
|
// This test file tests the following early error:
|
||||||
|
Static Semantics: Early Errors
|
||||||
|
|
||||||
|
ClassElement : staticFieldDefinition;
|
||||||
|
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
|
||||||
|
features: [class-fields]
|
||||||
|
template: propname-error
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- static
|
||||||
|
static
|
||||||
|
//- propname
|
||||||
|
constructor
|
20
src/class-fields/static-propname-prototype.case
Normal file
20
src/class-fields/static-propname-prototype.case
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: Static class fields cannot have PropName 'prototype'
|
||||||
|
info: |
|
||||||
|
|
||||||
|
// This test file tests the following early error:
|
||||||
|
Static Semantics: Early Errors
|
||||||
|
|
||||||
|
ClassElement : staticFieldDefinition;
|
||||||
|
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
|
||||||
|
features: [class-fields]
|
||||||
|
template: propname-error
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- static
|
||||||
|
static
|
||||||
|
//- propname
|
||||||
|
prototype
|
Loading…
x
Reference in New Issue
Block a user