public class ExportTestFunctions extends java.lang.Object implements CompilerPass
Modifier and Type | Class and Description |
---|---|
private class |
ExportTestFunctions.ExportTestFunctionsNodes |
Modifier and Type | Field and Description |
---|---|
private AbstractCompiler |
compiler |
private java.lang.String |
exportPropertyFunction |
private java.lang.String |
exportSymbolFunction |
private static Pattern |
TEST_FUNCTIONS_NAME_PATTERN |
Constructor and Description |
---|
ExportTestFunctions(AbstractCompiler compiler,
java.lang.String exportSymbolFunction,
java.lang.String exportPropertyFunction)
Creates a new export test functions compiler pass.
|
Modifier and Type | Method and Description |
---|---|
private void |
exportTestFunctionAsProperty(java.lang.String fullyQualifiedFunctionName,
Node parent,
Node node,
Node scriptNode) |
private void |
exportTestFunctionAsSymbol(java.lang.String testFunctionName,
Node node,
Node scriptNode) |
static boolean |
isTestFunction(java.lang.String functionName)
Whether a function is recognized as a test function.
|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
private static final Pattern TEST_FUNCTIONS_NAME_PATTERN
private AbstractCompiler compiler
private final java.lang.String exportSymbolFunction
private final java.lang.String exportPropertyFunction
ExportTestFunctions(AbstractCompiler compiler, java.lang.String exportSymbolFunction, java.lang.String exportPropertyFunction)
compiler
- exportSymbolFunction
- The function name used to export symbols in JS.exportPropertyFunction
- The function name used to export properties
in JS.public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS treeprivate void exportTestFunctionAsSymbol(java.lang.String testFunctionName, Node node, Node scriptNode)
private void exportTestFunctionAsProperty(java.lang.String fullyQualifiedFunctionName, Node parent, Node node, Node scriptNode)
public static boolean isTestFunction(java.lang.String functionName)
functionName
- The name of the functiontrue
if the function is recognized as a test function.