diff options
Diffstat (limited to 'js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js')
-rw-r--r-- | js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js new file mode 100644 index 0000000000..b5bed2447f --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// 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. + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + constructor() { + super(); + } +}; |