@Override public JSType caseObjectType(ObjectType type) { if (value.equals("function")) { JSType ctorType = getNativeType(U2U_CONSTRUCTOR_TYPE); if (resultEqualsValue) { // Objects are restricted to "Function", subtypes are left return ctorType.getGreatestSubtype(type); } else { // Only filter out subtypes of "function" return type.isSubtypeOf(ctorType) ? null : type; } } return matchesExpectation("object") ? type : null; }
@Override public JSType caseObjectType(ObjectType type) { if (value.equals("function")) { JSType ctorType = getNativeType(U2U_CONSTRUCTOR_TYPE); if (resultEqualsValue) { // Objects are restricted to "Function", subtypes are left return ctorType.getGreatestSubtype(type); } else { // Only filter out subtypes of "function" return type.isSubtype(ctorType) ? null : type; } } return matchesExpectation("object") ? type : null; }
@Override public JSType caseStringType() { return matchesExpectation("string") ? getNativeType(STRING_TYPE) : null; }
@Override public JSType caseNumberType() { return matchesExpectation("number") ? getNativeType(NUMBER_TYPE) : null; }
@Override public JSType caseBooleanType() { return matchesExpectation("boolean") ? getNativeType(BOOLEAN_TYPE) : null; }
@Override public JSType caseStringType() { return matchesExpectation("string") ? getNativeType(STRING_TYPE) : null; }
@Override public JSType caseVoidType() { return matchesExpectation("undefined") ? getNativeType(VOID_TYPE) : null; } }
@Override public JSType caseNullType() { return matchesExpectation("object") ? getNativeType(NULL_TYPE) : null; }
@Override public JSType caseFunctionType(FunctionType type) { return matchesExpectation("function") ? type : null; }
@Override public JSType caseNullType() { return matchesExpectation("object") ? getNativeType(NULL_TYPE) : null; }
@Override public JSType caseSymbolType() { return matchesExpectation("symbol") ? getNativeType(SYMBOL_TYPE) : null; }
@Override public JSType caseBooleanType() { return matchesExpectation("boolean") ? getNativeType(BOOLEAN_TYPE) : null; }
@Override public JSType caseNumberType() { return matchesExpectation("number") ? getNativeType(NUMBER_TYPE) : null; }
@Override public JSType caseFunctionType(FunctionType type) { return matchesExpectation("function") ? type : null; }
@Override public JSType caseVoidType() { return matchesExpectation("undefined") ? getNativeType(VOID_TYPE) : null; } }