private class DisambiguateProperties.Property
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
name
The name of the property.
|
private java.util.Set<JSType> |
recordInterfacesCache
For every property p and type t, we only need to run recordInterfaces
once.
|
(package private) java.util.Map<Node,JSType> |
rootTypesByNode
A map from nodes that need renaming to the highest type in the prototype
chain containing the field for each node.
|
(package private) boolean |
skipRenaming
If true, do not rename any instance of this field, as it has been
referenced from an unknown type.
|
private UnionFind<JSType> |
types
All top types on which the field exists, grouped together if related.
|
(package private) java.util.Set<JSType> |
typesToSkip
A set of types for which renaming this field should be skipped.
|
Constructor and Description |
---|
Property(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addType(JSType type,
JSType relatedType)
Record that this property is referenced from this type.
|
(package private) void |
addTypeToSkip(JSType type)
Records the given type as one to skip for this property.
|
(package private) void |
expandTypesToSkip()
Invalidates any types related to invalid types.
|
(package private) UnionFind<JSType> |
getTypes()
Returns the types on which this field is referenced.
|
(package private) boolean |
invalidate()
Invalidates a field from renaming.
|
(package private) boolean |
scheduleRenaming(Node node,
JSType type)
Schedule the node to potentially be renamed.
|
(package private) boolean |
shouldRename()
Returns true if any instance of this property should be renamed.
|
(package private) boolean |
shouldRename(JSType type)
Returns true if this property should be renamed on this type.
|
final java.lang.String name
private UnionFind<JSType> types
java.util.Set<JSType> typesToSkip
boolean skipRenaming
java.util.Map<Node,JSType> rootTypesByNode
private final java.util.Set<JSType> recordInterfacesCache
void addType(JSType type, JSType relatedType)
void addTypeToSkip(JSType type)
void expandTypesToSkip()
boolean shouldRename()
boolean shouldRename(JSType type)
boolean invalidate()
boolean scheduleRenaming(Node node, JSType type)
node
- the node to renametype
- the highest type in the prototype chain for which the
property is defined