Add cases for static methods with super

This commit is contained in:
Leo Balter 2018-09-05 17:04:13 -04:00 committed by Rick Waldron
parent 84ca816378
commit 4b386c0ae5
10 changed files with 207 additions and 0 deletions

View File

@ -0,0 +1,21 @@
// 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 Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [async-iteration]
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static async * method() {
super();
}

View File

@ -0,0 +1,21 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Async Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [async-functions]
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static async method() {
super();
}

View File

@ -0,0 +1,21 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Generator Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [generators]
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static * method() {
super();
}

View File

@ -0,0 +1,20 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Accessor get Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static get method() {
super();
}

View File

@ -0,0 +1,20 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static method() {
super();
}

View File

@ -0,0 +1,21 @@
// 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 contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [async-iteration, class-static-methods-private]
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static async * #method() {
super();
}

View File

@ -0,0 +1,21 @@
// 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 contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [async-functions, class-static-methods-private]
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static async #method() {
super();
}

View File

@ -0,0 +1,21 @@
// 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 contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [generators, class-static-methods-private]
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static * #method() {
super();
}

View File

@ -0,0 +1,21 @@
// 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 contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [class-static-methods-private]
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static #method() {
super();
}

View File

@ -0,0 +1,20 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static Accessor set Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : static MethodDefinition
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
---*/
// Uses a valid heritage to avoid false positives
//- heritage
extends Function
//- elements
static set method(_) {
super();
}