class MarkNoSideEffectCalls extends java.lang.Object implements CompilerPass
Modifier and Type | Class and Description |
---|---|
private class |
MarkNoSideEffectCalls.GatherNoSideEffectFunctions
Gather function nodes that have @nosideeffects annotations.
|
private class |
MarkNoSideEffectCalls.SetNoSideEffectCallProperty
Set the no side effects property for CALL and NEW nodes that
refer to function names that are known to have no side effects.
|
Modifier and Type | Field and Description |
---|---|
private AbstractCompiler |
compiler |
(package private) static DiagnosticType |
INVALID_NO_SIDE_EFFECT_ANNOTATION |
private java.util.Set<Node> |
noSideEffectFunctionNames |
Constructor and Description |
---|
MarkNoSideEffectCalls(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
definitionTypeContainsFunctionType(DefinitionsRemover.Definition def)
Determines if the type of the value of the RHS expression can
be a function node.
|
private static boolean |
hasNoSideEffectsAnnotation(Node node)
Get the value of the @nosideeffects annotation stored in the
doc info.
|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
static final DiagnosticType INVALID_NO_SIDE_EFFECT_ANNOTATION
private final AbstractCompiler compiler
private final java.util.Set<Node> noSideEffectFunctionNames
MarkNoSideEffectCalls(AbstractCompiler compiler)
public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS treeprivate static boolean definitionTypeContainsFunctionType(DefinitionsRemover.Definition def)
private static boolean hasNoSideEffectsAnnotation(Node node)