add generation cases for special methods with propname constructor

This commit is contained in:
Leo Balter 2018-09-05 16:01:08 -04:00 committed by Rick Waldron
parent 2720e08dae
commit 46e03c3875
9 changed files with 80 additions and 66 deletions

View File

@ -22,8 +22,6 @@ info: |
# IdentifierName
template: syntax/invalid
negative:
features: [class-fields-private]
---*/

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: Async Generator Methods cannot be named "constructor"
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
template: syntax/invalid
features: [async-iteration]
---*/
//- fields
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: Async Methods cannot be named "constructor"
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
template: syntax/invalid
features: [async-functions]
---*/
//- fields
async constructor() {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Generator Methods cannot be named "constructor"
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
template: syntax/invalid
features: [generators]
---*/
//- fields
* constructor() {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Generator Methods cannot be named "constructor"
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
template: syntax/invalid
features: [generators]
---*/
//- fields
get constructor() {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2018 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Generator Methods cannot be named "constructor"
info: |
Class Definitions / Static Semantics: Early Errors
ClassElement : MethodDefinition
It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
template: syntax/invalid
features: [generators]
---*/
//- fields
set constructor() {}

View File

@ -1,22 +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 "constructor" and SpecialMethod of MethodDefinition is true.
(GeneratorMethod)
negative:
phase: parse
type: SyntaxError
features: [generators]
---*/
throw "Test262: This statement should not be evaluated.";
class A {
* constructor() {}
}

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 "constructor" and SpecialMethod of MethodDefinition is true.
(get)
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
class A {
get constructor() {}
}

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 "constructor" and SpecialMethod of MethodDefinition is true.
(set)
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
class A {
set constructor(_) {}
}