class RecordFunctionInformation extends NodeTraversal.AbstractPostOrderCallback implements CompilerPass
Modifier and Type | Field and Description |
---|---|
private Compiler |
compiler |
private FunctionNames |
functionNames |
private FunctionInformationMap.Builder |
mapBuilder
Protocol buffer builder.
|
private JSModuleGraph |
moduleGraph |
Constructor and Description |
---|
RecordFunctionInformation(Compiler compiler,
FunctionNames functionNames)
Creates a record function information compiler pass.
|
Modifier and Type | Method and Description |
---|---|
(package private) FunctionInformationMap |
getMap()
Returns the built-out map.
|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
void |
visit(NodeTraversal t,
Node n,
Node parent)
Visits a node in postorder (after its children have been visited).
|
shouldTraverse
private final Compiler compiler
private final FunctionNames functionNames
private final JSModuleGraph moduleGraph
private final FunctionInformationMap.Builder mapBuilder
RecordFunctionInformation(Compiler compiler, FunctionNames functionNames)
compiler
- The JSCompilerfunctionNames
- Assigned function identifiers.FunctionInformationMap getMap()
public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS treepublic void visit(NodeTraversal t, Node n, Node parent)
NodeTraversal.Callback
Visits a node in postorder (after its children have been visited).
A node is visited only if all its parents should be traversed
(NodeTraversal.Callback.shouldTraverse(NodeTraversal, Node, Node)
).
Implementations can have side effects (e.g. modifying the parse tree).
visit
in interface NodeTraversal.Callback