Add cases for non-ctor methods containing direct super

This commit is contained in:
Leo Balter 2018-09-05 16:45:07 -04:00 committed by Rick Waldron
parent 585dac6d46
commit 92c83dfbd4
14 changed files with 177 additions and 91 deletions

View File

@ -0,0 +1,18 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Async Generator Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [async-iteration]
---*/
//- elements
async * method() {
super();
}

View File

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

View File

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

View File

@ -0,0 +1,17 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Accessor get Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
---*/
//- elements
get method() {
super();
}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
---*/
//- elements
method() {
super();
}

View File

@ -0,0 +1,18 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Private Async Generators Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [async-iteration, class-methods-private]
---*/
//- elements
async * #method() {
super();
}

View File

@ -0,0 +1,18 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Private Async Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [async-functions, class-methods-private]
---*/
//- elements
async #method() {
super();
}

View File

@ -0,0 +1,18 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Private Generators Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [generators, class-methods-private]
---*/
//- elements
* #method() {
super();
}

View File

@ -0,0 +1,18 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Private Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
features: [class-methods-private]
---*/
//- elements
#method() {
super();
}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Accessor set Methods cannot contain direct super
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
template: syntax/invalid
---*/
//- elements
set method(_) {
super();
}

View File

@ -1,21 +0,0 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 14.5.1
description: >
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
class A {
method() {
super();
}
}

View File

@ -1,24 +0,0 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 14.5.1
description: >
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
(GeneratorMethod)
negative:
phase: parse
type: SyntaxError
features: [generators]
---*/
throw "Test262: This statement should not be evaluated.";
class A {
* method() {
super();
}
}

View File

@ -1,23 +0,0 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 14.5.1
description: >
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
(get)
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
class A {
get method() {
super();
}
}

View File

@ -1,23 +0,0 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 14.5.1
description: >
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
(set)
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
class A {
set method(_) {
super();
}
}