JSSuperConstructorCall
Super constructor call in the constructor of a non-native JS class.
Exactly one such node must appear in the constructor of a non-native JS class, at the top-level (possibly as a direct child of a top-level Block
). Any other use of this node is invalid.
Statements before this node, as well as the args
, cannot contain any This()
node. Statements after this node can use This()
.
After the execution of this node, it is guaranteed that all fields declared in the current class have been created and initialized. Up to that point, accessing any field declared in this class (e.g., through an overridden method called from the super constructor) is undefined behavior.
All in all, the shape of a constructor is therefore:
{
statementsNotUsingThis();
JSSuperConstructorCall(...argsNotUsingThis);
statementsThatMayUseThis()
}
which currently translates to something of the following shape:
{
statementsNotUsingThis();
super(...argsNotUsingThis);
this.privateField1 = 0;
this["publicField2"] = false;
statementsThatMayUseThis()
}
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Treetrait TreeOrJSSpreadclass IRNodeclass Objecttrait Matchableclass Any