private class RescopeGlobalSymbols.RewriteGlobalFunctionStatementsToVarAssignmentsCallback extends NodeTraversal.AbstractShallowStatementCallback
function test(){}
becomes
var test = function (){}
After this traversal, the special case of global function statements
can be ignored.| Modifier | Constructor and Description |
|---|---|
private |
RewriteGlobalFunctionStatementsToVarAssignmentsCallback() |
| Modifier and Type | Method and Description |
|---|---|
void |
visit(NodeTraversal t,
Node n,
Node parent)
Visits a node in postorder (after its children have been visited).
|
shouldTraverseprivate RewriteGlobalFunctionStatementsToVarAssignmentsCallback()
public void visit(NodeTraversal t, Node n, Node parent)
NodeTraversal.CallbackVisits 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).