class SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor {
@Override
public JSType caseObjectType(ObjectType type) {
return applyCommonRestriction(type);
}
}
class SemanticReverseAbstractInterpreter.RestrictByFalseInstanceOfResultVisitor {
@Override
public JSType caseObjectType(ObjectType type) {
if (target.isUnknownType()) {
return type;
}
FunctionType funcTarget = (FunctionType) target;
if (funcTarget.hasInstanceType()) {
if (type.isSubtype(funcTarget.getInstanceType())) {
return null;
}
return type;
}
return null;
}
}
|