Search in sources :

Example 21 with ObjectTypeI

use of com.google.javascript.rhino.ObjectTypeI in project closure-compiler by google.

the class TypeSubject method isObjectTypeWithProperty.

public TypeSubject isObjectTypeWithProperty(String propName) {
    isLiteralObject();
    ObjectTypeI objType = actual().toMaybeObjectType();
    TypeI actualPropType = objType.getPropertyType(propName);
    assertNotNull("Type " + actualAsString() + " does not have property " + propName, actualPropType);
    return this;
}
Also used : ObjectTypeI(com.google.javascript.rhino.ObjectTypeI) TypeI(com.google.javascript.rhino.TypeI) ObjectTypeI(com.google.javascript.rhino.ObjectTypeI)

Example 22 with ObjectTypeI

use of com.google.javascript.rhino.ObjectTypeI in project closure-compiler by google.

the class TypeSubject method isObjectTypeWithoutProperty.

public void isObjectTypeWithoutProperty(String propName) {
    isLiteralObject();
    ObjectTypeI objType = actual().toMaybeObjectType();
    TypeI actualPropType = objType.getPropertyType(propName);
    assertNull("Type " + actualAsString() + " should not have property " + propName, actualPropType);
}
Also used : ObjectTypeI(com.google.javascript.rhino.ObjectTypeI) TypeI(com.google.javascript.rhino.TypeI) ObjectTypeI(com.google.javascript.rhino.ObjectTypeI)

Aggregations

ObjectTypeI (com.google.javascript.rhino.ObjectTypeI)22 TypeI (com.google.javascript.rhino.TypeI)10 FunctionTypeI (com.google.javascript.rhino.FunctionTypeI)8 JSDocInfo (com.google.javascript.rhino.JSDocInfo)4 Node (com.google.javascript.rhino.Node)4 Visibility (com.google.javascript.rhino.JSDocInfo.Visibility)3 StaticSourceFile (com.google.javascript.rhino.StaticSourceFile)2 TreeSet (java.util.TreeSet)2 Nullable (javax.annotation.Nullable)2 Token (com.google.javascript.rhino.Token)1 TypeIRegistry (com.google.javascript.rhino.TypeIRegistry)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1