mirror of https://github.com/tc39/test262.git
Final cases to move to tests generation
This commit is contained in:
parent
bcfc576af4
commit
8524805f25
|
@ -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: >
|
||||||
|
It is a SyntaxError if the class body has more than one constructor
|
||||||
|
info: |
|
||||||
|
ClassBody : ClassElementList
|
||||||
|
It is a Syntax Error if PrototypePropertyNameList of ClassElementList contains more
|
||||||
|
than one occurrence of "constructor".
|
||||||
|
template: syntax/invalid
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- elements
|
||||||
|
constructor() {}
|
||||||
|
constructor() {}
|
|
@ -1,16 +1,18 @@
|
||||||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es6id: 14.5.1
|
desc: >
|
||||||
description: >
|
A constructor is valid without a super call in the constructor and heritage
|
||||||
|
info: |
|
||||||
ClassTail : ClassHeritageopt { ClassBody }
|
ClassTail : ClassHeritageopt { ClassBody }
|
||||||
|
|
||||||
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
|
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
|
||||||
1. Let constructor be ConstructorMethod of ClassBody.
|
1. Let constructor be ConstructorMethod of ClassBody.
|
||||||
2. If constructor is empty, return false.
|
2. If constructor is empty, return false.
|
||||||
3. Return HasDirectSuper of constructor.
|
3. Return HasDirectSuper of constructor.
|
||||||
|
template: syntax/valid
|
||||||
---*/
|
---*/
|
||||||
class A {
|
|
||||||
constructor() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//- elements
|
||||||
|
constructor() {}
|
|
@ -1,24 +1,20 @@
|
||||||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es6id: 14.5.1
|
desc: >
|
||||||
description: >
|
It is a SyntaxError if class has no heritage and constructor has a direct super
|
||||||
|
info: |
|
||||||
ClassTail : ClassHeritageopt { ClassBody }
|
ClassTail : ClassHeritageopt { ClassBody }
|
||||||
|
|
||||||
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
|
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
|
||||||
1. Let constructor be ConstructorMethod of ClassBody.
|
1. Let constructor be ConstructorMethod of ClassBody.
|
||||||
2. If constructor is empty, return false.
|
2. If constructor is empty, return false.
|
||||||
3. Return HasDirectSuper of constructor.
|
3. Return HasDirectSuper of constructor.
|
||||||
|
template: syntax/invalid
|
||||||
negative:
|
|
||||||
phase: parse
|
|
||||||
type: SyntaxError
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
//- elements
|
||||||
class A {
|
constructor() {
|
||||||
constructor() {
|
super();
|
||||||
super();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +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: >
|
|
||||||
ClassBody : ClassElementList
|
|
||||||
|
|
||||||
It is a Syntax Error if PrototypePropertyNameList of ClassElementList contains more than one occurrence of "constructor".
|
|
||||||
|
|
||||||
negative:
|
|
||||||
phase: parse
|
|
||||||
type: SyntaxError
|
|
||||||
---*/
|
|
||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
|
||||||
class A {
|
|
||||||
constructor() {}
|
|
||||||
constructor() {}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue