Search in sources :

Example 1 with JSTypes

use of com.google.javascript.jscomp.newtypes.JSTypes in project closure-compiler by google.

the class GlobalTypeInfoCollector method defineObjectAndFunctionIfMissing.

private void defineObjectAndFunctionIfMissing() {
    JSTypes commonTypes = getCommonTypes();
    if (commonTypes.getObjectType() == null) {
        commonTypes.setObjectType(dummyRawTypeForMissingExterns("Object"));
    }
    if (commonTypes.getLiteralObjNominalType() == null) {
        RawNominalType objLitRawType = dummyRawTypeForMissingExterns(JSTypes.OBJLIT_CLASS_NAME);
        objLitRawType.addSuperClass(commonTypes.getObjectType());
        commonTypes.setLiteralObjNominalType(objLitRawType);
    }
    if (commonTypes.getFunctionType() == null) {
        commonTypes.setFunctionType(dummyRawTypeForMissingExterns("Function"));
    }
}
Also used : JSTypes(com.google.javascript.jscomp.newtypes.JSTypes) RawNominalType(com.google.javascript.jscomp.newtypes.RawNominalType)

Aggregations

JSTypes (com.google.javascript.jscomp.newtypes.JSTypes)1 RawNominalType (com.google.javascript.jscomp.newtypes.RawNominalType)1