Name
A simple name: an identifier that is not a keyword. Node type is Token.NAME.
Also used for a few non-identifier names that are part of the language syntax, such as the "get" and "set" pseudo-keywords in object initializers.
Constructors
Properties
The absolute document position, computed by adding this node's relative position to the relative positions of all its parents.
The Scope in which this name is defined, or null if it is not defined in the current lexical scope chain.
The innermost enclosing function, or null. The search begins with the parent.
The node's identifier. Setting it also updates the node length.
Comments on the same line as the statement, for example the trailing comment in if (x == 2) // note.
True when this name is known to be defined as a symbol in a lexical scope other than the top-level one: a local variable, a non-global let binding, a function parameter, a loop variable, and so on. False when it resolves to the top-level scope or is not in the symbol table at all, which may mean an external or built-in name.
The Scope associated with this node. Only used by (and set by) the code generator, so it is always null in frontend AST-processing code. Use definingScope to find the lexical scope in which this name is defined.
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.
The length of this node's identifier, so you can pretend it is a String. Not the same as AstNode.length, which is the source range the node covers.
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. There are no children to visit.