ctor-called-after-fields-init.js (859B)
1 // This file was procedurally generated from the following sources: 2 // - src/class-elements/ctor-called-after-fields-init.case 3 // - src/class-elements/default/cls-decl.template 4 /*--- 5 description: The constructor method is called after the fields are initalized (field definitions in a class declaration) 6 esid: prod-FieldDefinition 7 features: [class-fields-public, class] 8 flags: [generated] 9 info: | 10 [[Construct]] ( argumentsList, newTarget) 11 12 8. If kind is "base", then 13 a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). 14 b. Let result be InitializeInstanceFields(thisArgument, F). 15 ... 16 ... 17 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). 18 ... 19 20 ---*/ 21 var ctor; 22 23 24 class C { 25 constructor() { 26 ctor = this.foo; 27 } 28 foo = 42; 29 } 30 31 var c = new C(); 32 33 assert.sameValue(ctor, 42); 34 35 reportCompare(0, 0);