test262/test/language/statements/class/elements/ctor-called-after-fields-in...

34 lines
837 B
JavaScript
Raw Normal View History

2017-11-13 23:32:32 +01:00
// This file was procedurally generated from the following sources:
2018-09-05 22:12:46 +02:00
// - src/class-elements/ctor-called-after-fields-init.case
// - src/class-elements/default/cls-decl.template
2017-11-13 23:32:32 +01:00
/*---
description: The constructor method is called after the fields are initalized (field definitions in a class declaration)
esid: prod-FieldDefinition
2018-08-31 21:22:43 +02:00
features: [class-fields-public, class]
2017-11-13 23:32:32 +01:00
flags: [generated]
info: |
[[Construct]] ( argumentsList, newTarget)
8. If kind is "base", then
a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
b. Let result be InitializeInstanceFields(thisArgument, F).
...
...
11. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
...
---*/
var ctor;
class C {
constructor() {
ctor = this.foo;
}
foo = 42;
}
var c = new C();
assert.sameValue(ctor, 42);