mirror of https://github.com/tc39/test262.git
Generate tests
This commit is contained in:
parent
8524805f25
commit
94a40cb474
|
@ -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() {}
|
||||
};
|
|
@ -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();
|
||||
}
|
||||
};
|
|
@ -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() {}
|
||||
};
|
|
@ -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() {}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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() {}
|
||||
}
|
Loading…
Reference in New Issue