final class PolymerPassSuppressBehaviors extends NodeTraversal.AbstractPostOrderCallback
Modifier and Type | Field and Description |
---|---|
private AbstractCompiler |
compiler |
Constructor and Description |
---|
PolymerPassSuppressBehaviors(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
private static void |
addBehaviorSuppressions(Node behaviorValue) |
private static boolean |
isBehavior(Node value) |
private static void |
stripPropertyTypes(Node behaviorValue) |
private void |
suppressBehavior(Node behaviorValue)
Strip property type annotations and add suppress checkTypes and globalThis on functions.
|
private static void |
suppressDefaultValues(Node behaviorValue) |
void |
visit(NodeTraversal t,
Node n,
Node parent)
Visits a node in postorder (after its children have been visited).
|
shouldTraverse
private final AbstractCompiler compiler
PolymerPassSuppressBehaviors(AbstractCompiler compiler)
public 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).
private void suppressBehavior(Node behaviorValue)
private static boolean isBehavior(Node value)
private static void stripPropertyTypes(Node behaviorValue)
private static void suppressDefaultValues(Node behaviorValue)
private static void addBehaviorSuppressions(Node behaviorValue)