mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
add generation cases for special methods with propname constructor
This commit is contained in:
parent
2720e08dae
commit
46e03c3875
src/class-elements
grammar-privatenames-same-line-error.casegrammar-special-meth-ctor-async-gen.casegrammar-special-meth-ctor-async-meth.casegrammar-special-meth-ctor-gen.casegrammar-special-meth-ctor-get.casegrammar-special-meth-ctor-set.case
test/language/statements/class/syntax/early-errors
@ -22,8 +22,6 @@ info: |
|
||||
# IdentifierName
|
||||
|
||||
template: syntax/invalid
|
||||
negative:
|
||||
|
||||
features: [class-fields-private]
|
||||
---*/
|
||||
|
||||
|
16
src/class-elements/grammar-special-meth-ctor-async-gen.case
Normal file
16
src/class-elements/grammar-special-meth-ctor-async-gen.case
Normal 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() {}
|
16
src/class-elements/grammar-special-meth-ctor-async-meth.case
Normal file
16
src/class-elements/grammar-special-meth-ctor-async-meth.case
Normal 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() {}
|
16
src/class-elements/grammar-special-meth-ctor-gen.case
Normal file
16
src/class-elements/grammar-special-meth-ctor-gen.case
Normal 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() {}
|
16
src/class-elements/grammar-special-meth-ctor-get.case
Normal file
16
src/class-elements/grammar-special-meth-ctor-get.case
Normal 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() {}
|
16
src/class-elements/grammar-special-meth-ctor-set.case
Normal file
16
src/class-elements/grammar-special-meth-ctor-set.case
Normal 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() {}
|
@ -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() {}
|
||||
}
|
||||
|
@ -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() {}
|
||||
}
|
||||
|
@ -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(_) {}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user