summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/elements/super-access-from-arrow-func-on-field.js
blob: 39b381e1ea8086ea3964c65df4b9479fb984230a (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
29
30
31
32
33
34
35
36
37
38
39
// This file was procedurally generated from the following sources:
// - src/class-elements/super-access-from-arrow-func-on-field.case
// - src/class-elements/default/cls-decl.template
/*---
description: super inside arrow functions on field initializer resolves to class' super (field definitions in a class declaration)
esid: prod-FieldDefinition
features: [class-fields-public, class-static-fields-public, class]
flags: [generated]
info: |
    ClassElementName :
      PropertyName
      PrivateName

    SuperProperty:
      super[Expression]
      super.IdentifierName

---*/


class C {
  func = () => {
      super.prop = 'test262';
  }

  static staticFunc = () => {
      super.staticProp = 'static test262';
  }
}

let c = new C();
c.func();
assert.sameValue(c.prop, 'test262');

C.staticFunc();
assert.sameValue(C.staticProp, 'static test262');


reportCompare(0, 0);