Private names disallowed for constructor

This commit is contained in:
Leo Balter 2018-09-05 18:04:21 -04:00 committed by Rick Waldron
parent 94a40cb474
commit 75a579a0d4
6 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Private Fields cannot be named constructor
info: |
Class Definitions / Static Semantics: Early Errors
ClassElementName : PrivateName ;
It is a Syntax Error if StringValue of PrivateName is "#constructor"
template: syntax/invalid
features: [class-fields-private]
---*/
//- elements
#constructor

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Async Generator Private Methods cannot be named constructor
info: |
Class Definitions / Static Semantics: Early Errors
ClassElementName : PrivateName ;
It is a Syntax Error if StringValue of PrivateName is "#constructor"
template: syntax/invalid
features: [async-iteration, class-static-methods-private]
---*/
//- elements
static async * #constructor() {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Async Private Methods cannot be named constructor
info: |
Class Definitions / Static Semantics: Early Errors
ClassElementName : PrivateName ;
It is a Syntax Error if StringValue of PrivateName is "#constructor"
template: syntax/invalid
features: [async-functions, class-static-methods-private]
---*/
//- elements
static async #constructor() {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Generator Private Methods cannot be named constructor
info: |
Class Definitions / Static Semantics: Early Errors
ClassElementName : PrivateName ;
It is a Syntax Error if StringValue of PrivateName is "#constructor"
template: syntax/invalid
features: [generators, class-static-methods-private]
---*/
//- elements
static * #constructor() {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Private Methods cannot be named constructor
info: |
Class Definitions / Static Semantics: Early Errors
ClassElementName : PrivateName ;
It is a Syntax Error if StringValue of PrivateName is "#constructor"
template: syntax/invalid
features: [class-static-methods-private]
---*/
//- elements
static #constructor() {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Private Fields cannot be named constructor
info: |
Class Definitions / Static Semantics: Early Errors
ClassElementName : PrivateName ;
It is a Syntax Error if StringValue of PrivateName is "#constructor"
template: syntax/invalid
features: [class-static-fields-private]
---*/
//- elements
static #constructor