private class ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor extends ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor
Modifier and Type | Field and Description |
---|---|
private boolean |
resultEqualsValue
true if the typeOf result is known to equal
value ; false if it is known not to equal
value . |
private java.lang.String |
value
A value known to be equal or not equal to the result of the
typeOf operation. |
Constructor and Description |
---|
RestrictByOneTypeOfResultVisitor(java.lang.String value,
boolean resultEqualsValue) |
Modifier and Type | Method and Description |
---|---|
JSType |
caseBooleanType()
Boolean value type's case.
|
JSType |
caseFunctionType(FunctionType type)
Function type's case.
|
JSType |
caseNoObjectType()
Bottom Object type's case.
|
JSType |
caseNullType()
Null type's case.
|
JSType |
caseNumberType()
Number value type's case.
|
JSType |
caseObjectType(ObjectType type)
Object type's case.
|
JSType |
caseStringType()
String value type's case.
|
protected JSType |
caseTopType(JSType topType)
Abstracts away the similarities between visiting the unknown type and the
all type.
|
JSType |
caseVoidType()
Void type's case.
|
private boolean |
matchesExpectation(java.lang.String result)
Computes whether the given result of a
typeof operator matches
expectations, i.e. |
caseAllType, caseEnumElementType, caseNamedType, caseNoType, caseProxyObjectType, caseTemplateType, caseTemplatizedType, caseUnionType, caseUnknownType
private final java.lang.String value
typeOf
operation.private final boolean resultEqualsValue
true
if the typeOf
result is known to equal
value
; false
if it is known not to equal
value
.RestrictByOneTypeOfResultVisitor(java.lang.String value, boolean resultEqualsValue)
private boolean matchesExpectation(java.lang.String result)
typeof
operator matches
expectations, i.e. whether a type that gives such a result should be
kept.protected JSType caseTopType(JSType topType)
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor
caseTopType
in class ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor
topType
- UNKNOWN_TYPE
or ALL_TYPE
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseAllType()
,
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseUnknownType()
public JSType caseNoObjectType()
Visitor
public JSType caseBooleanType()
Visitor
public JSType caseFunctionType(FunctionType type)
Visitor
public JSType caseNullType()
Visitor
public JSType caseNumberType()
Visitor
public JSType caseObjectType(ObjectType type)
Visitor
public JSType caseStringType()
Visitor