ClassNode
A class declaration or expression. Node type is Token.CLASS.
ClassDeclaration : class BindingIdentifier ClassTail
ClassExpression : class BindingIdentifier? ClassTail
ClassTail : ClassHeritage? { ClassBody? }Every part of the class that runs code is a function of its own: the constructor, which the parser makes up when the class has none, each method, each field initializer and each static block. The class itself only says how they hang together.
Properties
The absolute document position, computed by adding this node's relative position to the relative positions of all its parents.
The constructor, written in the class or made up for it.
The methods, accessors, fields and static blocks, in source order, without the constructor.
The innermost enclosing function, or null. The search begins with the parent.
Comments on the same line as the statement, for example the trailing comment in if (x == 2) // note.
True for a declaration, which binds the name in the enclosing block as well.
The private names the class body declares, each with its #, in the order first declared.
The expression after extends, or null when the class has no heritage.
The node type, e.g. Token.NAME.
Functions
A debugging representation of the parse tree starting at this node. Each line reads abs-pos name position length [identifier].
Checks that every return usage in a function body is consistent with strict mode. See the END_* flags for what the analysis reports.
Constructs an indentation string of indent steps.
Recursively unlabel every TARGET or YIELD node in the tree. Used only for inlining finally blocks where jsr instructions used to be.
Makes this node's position relative to a parent. The current position is assumed to be absolute and is decremented by parentPosition.
Visits this node and its children in an arbitrary order.