Debian Codegraph @

js/src/tests/test262/language/statements/class/elements/super-access-from-arrow-func-on-field.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-elements/super-access-from-arrow-func-on-field.case
3 // - src/class-elements/default/cls-decl.template
4 /*---
5 description: super inside arrow functions on field initializer resolves to class' super (field definitions in a class declaration)
6 esid: prod-FieldDefinition
7 features: [class-fields-public, class-static-fields-public, class]
8 flags: [generated]
9 info: |
10 ClassElementName :
11 PropertyName
12 PrivateName
13
14 SuperProperty:
15 super[Expression]
16 super.IdentifierName
17
18 ---*/
19
20
21 class C {
22 func = () => {
23 super.prop = 'test262';
24 }
25
26 static staticFunc = () => {
27 super.staticProp = 'static test262';
28 }
29 }
30
31 let c = new C();
32 c.func();
33 assert.sameValue(c.prop, 'test262');
34
35 C.staticFunc();
36 assert.sameValue(C.staticProp, 'static test262');
37
38
39 reportCompare(0, 0);