|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback
com.google.javascript.jscomp.ReplaceStrings
public class ReplaceStrings
Replaces JavaScript strings in the list of supplied methods with shortened forms. Useful for replacing debug message such as: throw new Error("Something bad happened"); with generated codes like: throw new Error("a"); This makes the compiled JavaScript smaller and prevents us from leaking details about the source code. Based in concept on the work by Jared Jacobs.
Method Summary | |
---|---|
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 post order (after its children have been visited). |
Methods inherited from class com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback |
---|
shouldTraverse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 post order (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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |