Final cases to move to tests generation

This commit is contained in:
Leo Balter 2018-09-05 17:57:16 -04:00 committed by Rick Waldron
parent bcfc576af4
commit 8524805f25
4 changed files with 33 additions and 39 deletions

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: >
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() {}

View File

@ -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() {}

View File

@ -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();
}
} }

View File

@ -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() {}
}