Skip to content

Commit 95a497e

Browse files
lauraharkercopybara-github
authored andcommitted
Delete unused methods in ObjectType and PropertyMap
PiperOrigin-RevId: 556977782
1 parent f13691d commit 95a497e

File tree

5 files changed

+0
-66
lines changed

5 files changed

+0
-66
lines changed

src/com/google/javascript/rhino/jstype/NoObjectType.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,6 @@ final boolean defineProperty(String propertyName, JSType type,
125125
return true;
126126
}
127127

128-
@Override
129-
public final boolean removeProperty(String name) {
130-
return false;
131-
}
132-
133128
@Override
134129
public final void setPropertyJSDocInfo(String propertyName, JSDocInfo info) {
135130
// Do nothing, specific properties do not have JSDocInfo.

src/com/google/javascript/rhino/jstype/ObjectType.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,6 @@ public final boolean defineInferredProperty(String propertyName,
411411
abstract boolean defineProperty(String propertyName, JSType type,
412412
boolean inferred, Node propertyNode);
413413

414-
/**
415-
* Removes the declared or inferred property from this ObjectType.
416-
*
417-
* @param propertyName the property's name
418-
* @return true if the property was removed successfully. False if the
419-
* property did not exist, or could not be removed.
420-
*/
421-
public boolean removeProperty(String propertyName) {
422-
return false;
423-
}
424-
425414
/**
426415
* Gets the node corresponding to the definition of the specified property. This could be the node
427416
* corresponding to declaration of the property or the node corresponding to the first reference

src/com/google/javascript/rhino/jstype/PropertyMap.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -129,37 +129,6 @@ private Iterable<ObjectType> getSecondaryParentObjects() {
129129
return parentSource.getCtorExtendedInterfaces();
130130
}
131131

132-
@Nullable
133-
OwnedProperty findTopMost(String name) {
134-
// Check primary parents which always has precendence over secondary.
135-
OwnedProperty found = null;
136-
for (PropertyMap map = this; map != null; map = map.getPrimaryParent()) {
137-
Property prop = map.properties.get(name);
138-
if (prop != null) {
139-
found = new OwnedProperty(map.parentSource, prop);
140-
}
141-
}
142-
if (found != null) {
143-
return found;
144-
}
145-
146-
// Recurse into secondary parents. Note that there is no single top most definition with
147-
// interfaces so we simple return the first result.
148-
for (PropertyMap map = this; map != null; map = map.getPrimaryParent()) {
149-
for (ObjectType o : map.getSecondaryParentObjects()) {
150-
PropertyMap parent = o.getPropertyMap();
151-
if (parent != null) {
152-
OwnedProperty e = parent.findTopMost(name);
153-
if (e != null) {
154-
return e;
155-
}
156-
}
157-
}
158-
}
159-
160-
return null;
161-
}
162-
163132
@Nullable
164133
OwnedProperty findClosest(String name) {
165134
// Check primary parents which always has precendence over secondary.
@@ -256,15 +225,6 @@ private void collectAllAncestors(Set<PropertyMap> ancestors) {
256225
}
257226
}
258227

259-
boolean removeProperty(String name) {
260-
if (properties.remove(name) == null) {
261-
return false;
262-
}
263-
264-
this.incrementCachedKeySetCounter();
265-
return true;
266-
}
267-
268228
void putProperty(String name, Property newProp) {
269229
Property oldProp = properties.get(name);
270230

src/com/google/javascript/rhino/jstype/PrototypeObjectType.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ boolean defineProperty(String name, JSType type, boolean inferred,
207207
return true;
208208
}
209209

210-
@Override
211-
public boolean removeProperty(String name) {
212-
return properties.removeProperty(name);
213-
}
214-
215210
@Override
216211
public void setPropertyJSDocInfo(String propertyName, JSDocInfo info) {
217212
if (info != null) {

src/com/google/javascript/rhino/jstype/ProxyObjectType.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,6 @@ boolean defineProperty(String propertyName, JSType type, boolean inferred, Node
305305
|| referencedObjType.defineProperty(propertyName, type, inferred, propertyNode);
306306
}
307307

308-
@Override
309-
public final boolean removeProperty(String name) {
310-
return referencedObjType == null ? false : referencedObjType.removeProperty(name);
311-
}
312-
313308
@Override
314309
protected JSType findPropertyTypeWithoutConsideringTemplateTypes(String propertyName) {
315310
return referencedType.findPropertyType(propertyName);

0 commit comments

Comments
 (0)