Skip to content

Commit

Permalink
[NTI] Remove unnecessary method and replace its calls with equivalent.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173578862
  • Loading branch information
dimvar authored and blickly committed Oct 27, 2017
1 parent e6866b5 commit 48d86ce
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
Expand Up @@ -312,7 +312,7 @@ public JSType getSuperPrototype() {
checkState(isUniqueConstructor());
NominalType nt = getNominalTypeIfSingletonObj(this.nominalType);
NominalType superClass = nt.getInstantiatedSuperclass();
return superClass == null ? null : superClass.getPrototypePropertyOfCtor();
return superClass == null ? null : superClass.getPrototypeObject();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/newtypes/JSType.java
Expand Up @@ -2041,7 +2041,7 @@ public final FunctionTypeI getSuperClassConstructor() {
@Override
public final JSType getPrototypeObject() {
checkState(this.isSingletonObj());
JSType proto = getNominalTypeIfSingletonObj().getPrototypePropertyOfCtor();
JSType proto = getNominalTypeIfSingletonObj().getPrototypeObject();
if (this.equals(proto)) {
// In JS's dynamic semantics, the only object without a __proto__ is
// Object.prototype, but it's not representable in NTI.
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/newtypes/JSTypes.java
Expand Up @@ -508,7 +508,7 @@ public JSType getNativeType(JSTypeNative typeId) {
return builtinFunction.toJSType();
case OBJECT_PROTOTYPE:
case TOP_LEVEL_PROTOTYPE:
return getTopObject().getNominalTypeIfSingletonObj().getPrototypePropertyOfCtor();
return getTopObject().getNominalTypeIfSingletonObj().getPrototypeObject();
case GLOBAL_THIS:
return getGlobalThis();
case I_ITERABLE_RESULT_TYPE:
Expand Down
5 changes: 0 additions & 5 deletions src/com/google/javascript/jscomp/newtypes/NominalType.java
Expand Up @@ -356,11 +356,6 @@ public NominalType getInstantiatedSuperclass() {
return this.rawType.getSuperClass().substituteGenerics(typeMap);
}

public JSType getPrototypePropertyOfCtor() {
checkState(this.rawType.isFrozen());
return this.rawType.getCtorPropDeclaredType("prototype");
}

// We require a frozen type for the interfaces here because the inheritance
// chain of each type may not be correct until after the type is frozen.
public ImmutableSet<NominalType> getInstantiatedInterfaces() {
Expand Down

0 comments on commit 48d86ce

Please sign in to comment.