private class NameAnalyzer.FindDeclarationsAndSetters extends NodeTraversal.AbstractPostOrderCallback
Modifier | Constructor and Description |
---|---|
private |
FindDeclarationsAndSetters() |
Modifier and Type | Method and Description |
---|---|
private void |
recordPrototypeSet(java.lang.String className,
java.lang.String prototypeProperty,
Node node)
Records the assignment to a prototype property of a global name,
if possible.
|
private void |
recordSet(java.lang.String name,
Node node)
Records the assignment of a value to a global name.
|
private void |
recordWriteOnProperties(java.lang.String parentName)
Record that the properties of this name have been written to.
|
void |
visit(NodeTraversal t,
Node n,
Node parent)
Visits a node in postorder (after its children have been visited).
|
shouldTraverse
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 recordSet(java.lang.String name, Node node)
name
- Fully qualified namenode
- The top node representing the name (GETPROP, NAME, STRING [objlit key],
or CALL [Object.defineProperties])private void recordPrototypeSet(java.lang.String className, java.lang.String prototypeProperty, Node node)
className
- The name of the class.prototypeProperty
- The name of the prototype property.node
- The top node representing the name (GETPROP)private void recordWriteOnProperties(java.lang.String parentName)