summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/elements/ternary-init-err-contains-super.js
blob: daff75a0a5cbda10d6aba86ce55d365711de5634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// |reftest| error:SyntaxError
// This file was procedurally generated from the following sources:
// - src/class-elements/init-err-contains-super.case
// - src/class-elements/initializer-error/cls-decl-fields-ternary.template
/*---
description: Syntax error if `super()` used in class field (ternary expression)
esid: sec-class-definitions-static-semantics-early-errors
features: [class, class-fields-public]
flags: [generated]
negative:
  phase: parse
  type: SyntaxError
info: |
    Static Semantics: Early Errors

      FieldDefinition:
        PropertyNameInitializeropt

      - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.

---*/


$DONOTEVALUATE();

class C {
  x = false ? {} : super();
}