Generate tests

This commit is contained in:
Leo Balter 2018-09-05 17:58:17 -04:00 committed by Rick Waldron
parent 8524805f25
commit 94a40cb474
6 changed files with 152 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-class-body-ctor-duplicate.case
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
/*---
description: It is a SyntaxError if the class body has more than one constructor (class expression)
esid: prod-ClassElement
features: [class]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
ClassBody : ClassElementList
It is a Syntax Error if PrototypePropertyNameList of ClassElementList contains more
than one occurrence of "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
constructor() {}
constructor() {}
};

View File

@ -0,0 +1,29 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-ctor-super-no-heritage.case
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
/*---
description: It is a SyntaxError if class has no heritage and constructor has a direct super (class expression)
esid: prod-ClassElement
features: [class]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
ClassTail : ClassHeritageopt { ClassBody }
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
1. Let constructor be ConstructorMethod of ClassBody.
2. If constructor is empty, return false.
3. Return HasDirectSuper of constructor.
---*/
throw "Test262: This statement should not be evaluated.";
var C = class {
constructor() {
super();
}
};

View File

@ -0,0 +1,22 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-class-body-ctor-no-heritage.case
// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
/*---
description: A constructor is valid without a super call in the constructor and heritage (class expression)
esid: prod-ClassElement
features: [class]
flags: [generated]
info: |
ClassTail : ClassHeritageopt { ClassBody }
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
1. Let constructor be ConstructorMethod of ClassBody.
2. If constructor is empty, return false.
3. Return HasDirectSuper of constructor.
---*/
var C = class {
constructor() {}
};

View File

@ -0,0 +1,25 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-class-body-ctor-duplicate.case
// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
/*---
description: It is a SyntaxError if the class body has more than one constructor (class declaration)
esid: prod-ClassElement
features: [class]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
ClassBody : ClassElementList
It is a Syntax Error if PrototypePropertyNameList of ClassElementList contains more
than one occurrence of "constructor".
---*/
throw "Test262: This statement should not be evaluated.";
class C {
constructor() {}
constructor() {}
}

View File

@ -0,0 +1,29 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-ctor-super-no-heritage.case
// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
/*---
description: It is a SyntaxError if class has no heritage and constructor has a direct super (class declaration)
esid: prod-ClassElement
features: [class]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
ClassTail : ClassHeritageopt { ClassBody }
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
1. Let constructor be ConstructorMethod of ClassBody.
2. If constructor is empty, return false.
3. Return HasDirectSuper of constructor.
---*/
throw "Test262: This statement should not be evaluated.";
class C {
constructor() {
super();
}
}

View File

@ -0,0 +1,22 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-class-body-ctor-no-heritage.case
// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template
/*---
description: A constructor is valid without a super call in the constructor and heritage (class declaration)
esid: prod-ClassElement
features: [class]
flags: [generated]
info: |
ClassTail : ClassHeritageopt { ClassBody }
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
1. Let constructor be ConstructorMethod of ClassBody.
2. If constructor is empty, return false.
3. Return HasDirectSuper of constructor.
---*/
class C {
constructor() {}
}