Program class

The root node of a JavaScript AST, representing the top-level scope.

Inheritance

Constructors

Program(List<Statement> body)

Properties

body ↔ List<Statement>
getter/setter pair
enclosingFunction → FunctionNode?
Returns the FunctionNode enclosing this node, possibly the node itself, or null if not enclosed in any function.
no setterinherited
enclosingProgram → Program?
Returns the Program node enclosing this node, possibly the node itself, or null if not enclosed in any program.
no setterinherited
end ↔ int
Source-code offset.
getter/setter pairinherited
endLine ↔ int
getter/setter pairinherited
environment ↔ Set<String>
Variables declared in this scope, including the implicitly declared "arguments" variable.
getter/setter pairinherited
filename ↔ String?
Indicates where the program was parsed from. In principle, this can be anything, it is just a string passed to the parser for convenience.
getter/setter pairoverride-getter
hashCode → int
The hash code for this object.
no setterinherited
line ↔ int
1-based line number.
getter/setter pairinherited
location → String
A string with filename and line number.
no setterinherited
parent ↔ Node?
The parent of this node, or null if this is the Program node.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopeArea ↔ ScopeArea?
getter/setter pair
start ↔ int
Source-code offset.
getter/setter pairinherited
variables → Set<(String, Node)>
finalinherited

Methods

forEach(void callback(Node node)) → void
Visits the immediate children of this node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
visitBy<T>(Visitor<T> v) → T?
Calls the relevant visit method on the visitor.
override
visitBy1<T, A>(Visitor1<T, A> v, A arg) → T?
Calls the relevant visit method on the visitor.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited