@GwtIncompatible(value="FileInstrumentationData") class CoverageInstrumentationCallback extends NodeTraversal.AbstractPostOrderCallback
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
ARRAY_NAME_PREFIX |
private AbstractCompiler |
compiler |
private java.util.Map<java.lang.String,FileInstrumentationData> |
instrumentationData |
private CoverageInstrumentationPass.CoverageReach |
reach |
Constructor and Description |
---|
CoverageInstrumentationCallback(AbstractCompiler compiler,
java.util.Map<java.lang.String,FileInstrumentationData> instrumentationData,
CoverageInstrumentationPass.CoverageReach reach) |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
createArrayName(NodeTraversal traversal)
Returns a string that can be used as array name.
|
private static java.lang.String |
getFileName(NodeTraversal traversal)
Returns the name of the source file from which the given node originates.
|
private Node |
newArrayDeclarationNode(NodeTraversal traversal)
Create and return a new array declaration node.
|
private Node |
newHeaderNode(NodeTraversal traversal,
Node srcref) |
private Node |
newInstrumentationNode(NodeTraversal traversal,
Node node)
Creates and return a new instrumentation node.
|
void |
visit(NodeTraversal traversal,
Node node,
Node parent)
Instruments the JS code by inserting appropriate nodes into the AST.
|
shouldTraverse
private final AbstractCompiler compiler
private final java.util.Map<java.lang.String,FileInstrumentationData> instrumentationData
private final CoverageInstrumentationPass.CoverageReach reach
static final java.lang.String ARRAY_NAME_PREFIX
public CoverageInstrumentationCallback(AbstractCompiler compiler, java.util.Map<java.lang.String,FileInstrumentationData> instrumentationData, CoverageInstrumentationPass.CoverageReach reach)
private static java.lang.String getFileName(NodeTraversal traversal)
traversal
- the traversalprivate java.lang.String createArrayName(NodeTraversal traversal)
private Node newInstrumentationNode(NodeTraversal traversal, Node node)
private Node newArrayDeclarationNode(NodeTraversal traversal)
private Node newHeaderNode(NodeTraversal traversal, Node srcref)
public void visit(NodeTraversal traversal, Node node, Node parent)