Delete unused methods in JSTypeRegistry
Most of this code was for hotswap typechecking, which the compiler no longer supports.
@@ -237,7 +237,10 @@ public final class JSTypeRegistry {
this.resolver = JSTypeResolver.create(this);
this.nativeTypes = new JSType[JSTypeNative.values().length];
- resetForTypeCheck();
+ try (JSTypeResolver.Closer closer = this.resolver.openForDefinition()) {
+ initializeBuiltInTypes();
+ initializeRegistry();
+ }
}
private JSType getSentinelObjectLiteral() {
@@ -310,19 +313,6 @@ public final class JSTypeRegistry {
return reporter;
}
- /**
- * Reset to run the TypeCheck pass.
- */
- public void resetForTypeCheck() {
- try (JSTypeResolver.Closer closer = this.resolver.openForDefinition()) {
- typesIndexedByProperty.clear();
- eachRefTypeIndexedByProperty.clear();
- initializeBuiltInTypes();
- scopedNameTable.clear();
- initializeRegistry();
- }
- }
-
private void initializeBuiltInTypes() {
// These locals shouldn't be all caps.
BooleanType booleanType = new BooleanType(this);
@@ -1054,15 +1044,6 @@ public final class JSTypeRegistry {
scopedNameTable.put(getRootNodeForScope(scope), name, type);
}
- /**
- * Removes a type by name.
- *
- * @param name The name string.
- */
- public void removeType(StaticScope scope, String name) {
- scopedNameTable.remove(getRootNodeForScope(getLookupScope(scope, name)), name);
- }
-
private void registerNativeType(JSTypeNative typeId, JSType type) {
nativeTypes[typeId.ordinal()] = type;
}
@@ -1131,23 +1112,6 @@ public final class JSTypeRegistry {
}
}
- /**
- * Removes the index's reference to a property on the given type (if it is
- * currently registered). If the property is not registered on the type yet,
- * this method will not change internal state.
- *
- * @param propertyName the name of the property to unregister
- * @param type the type to unregister the property on.
- */
- public void unregisterPropertyOnType(String propertyName, JSType type) {
- // TODO(bashir): typesIndexedByProperty should also be updated!
- Map<String, ObjectType> typeSet =
- eachRefTypeIndexedByProperty.get(propertyName);
- if (typeSet != null) {
- typeSet.remove(type.toObjectType().getReferenceName());
- }
- }
-
/** A tristate value returned from canPropertyBeDefined. */
public enum PropDefinitionKind {
UNKNOWN, // The property is not known to be part of this type
@@ -1307,14 +1271,6 @@ public final class JSTypeRegistry {
return true;
}
- /**
- * Overrides a declared global type name. Throws an exception if this type name hasn't been
- * declared yet.
- */
- public void overwriteDeclaredType(String name, JSType type) {
- overwriteDeclaredType(null, name, type);
- }
-
/**
* Overrides a declared global type name. Throws an exception if this type name hasn't been
* declared yet.
@@ -1602,11 +1558,6 @@ public final class JSTypeRegistry {
return builder.build();
}
- /** Creates an empty parameter list node. */
- Node createEmptyParams() {
- return new Node(Token.PARAM_LIST);
- }
-
/**
* Creates a function type.
*
