class GatherRawExports extends NodeTraversal.AbstractPostOrderCallback implements CompilerPass
Modifier and Type | Field and Description |
---|---|
private AbstractCompiler |
compiler |
private java.util.Set<java.lang.String> |
exportedVariables |
private static java.lang.String[] |
GLOBAL_THIS_NAMES |
Constructor and Description |
---|
GatherRawExports(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getExportedVariableNames() |
private static boolean |
isGlobalThisObject(NodeTraversal t,
Node n) |
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 AbstractCompiler compiler
private static final java.lang.String[] GLOBAL_THIS_NAMES
private final java.util.Set<java.lang.String> exportedVariables
GatherRawExports(AbstractCompiler compiler)
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
private static boolean isGlobalThisObject(NodeTraversal t, Node n)
public java.util.Set<java.lang.String> getExportedVariableNames()