| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/class-fields/ctor-called-after-fields-init.case |
| 3 |
// - src/class-fields/default/cls-expr.template |
| 4 |
/*--- |
| 5 |
description: The constructor method is called after the fields are initalized (field definitions in a class expression) |
| 6 |
esid: prod-FieldDefinition |
| 7 |
features: [class, class-fields-public] |
| 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 |
var C = class { |
| 25 |
constructor() { |
| 26 |
ctor = this.foo; |
| 27 |
} |
| 28 |
foo = 42; |
| 29 |
} |
| 30 |
|
| 31 |
var c = new C(); |
| 32 |
|
| 33 |
assert.sameValue(ctor, 42); |