class CheckRegExp extends NodeTraversal.AbstractPostOrderCallback implements CompilerPass
Modifier and Type | Field and Description |
---|---|
private AbstractCompiler |
compiler |
private boolean |
globalRegExpPropertiesUsed |
(package private) static DiagnosticType |
MALFORMED_REGEXP |
private static java.util.Set<java.lang.String> |
REGEXP_PROPERTY_BLACKLIST |
(package private) static DiagnosticType |
REGEXP_REFERENCE |
Constructor and Description |
---|
CheckRegExp(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
boolean |
isGlobalRegExpPropertiesUsed() |
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
static final DiagnosticType REGEXP_REFERENCE
static final DiagnosticType MALFORMED_REGEXP
private static final java.util.Set<java.lang.String> REGEXP_PROPERTY_BLACKLIST
private final AbstractCompiler compiler
private boolean globalRegExpPropertiesUsed
public CheckRegExp(AbstractCompiler compiler)
public boolean isGlobalRegExpPropertiesUsed()
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