class CheckDebuggerStatement extends NodeTraversal.AbstractPostOrderCallback implements CompilerPass
CheckDebuggerStatement
checks for the presence of the "debugger"
statement in JavaScript code. It is appropriate to use this statement while
developing JavaScript; however, it is generally undesirable to include it in
production code.Modifier and Type | Field and Description |
---|---|
private AbstractCompiler |
compiler |
(package private) static DiagnosticType |
DEBUGGER_STATEMENT_PRESENT |
Constructor and Description |
---|
CheckDebuggerStatement(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
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 DEBUGGER_STATEMENT_PRESENT
private final AbstractCompiler compiler
public CheckDebuggerStatement(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