Search in sources :

Example 36 with TypeI

use of com.google.javascript.rhino.TypeI 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 37 with TypeI

use of com.google.javascript.rhino.TypeI 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

TypeI (com.google.javascript.rhino.TypeI)37 ObjectTypeI (com.google.javascript.rhino.ObjectTypeI)24 FunctionTypeI (com.google.javascript.rhino.FunctionTypeI)23 Node (com.google.javascript.rhino.Node)10 TypeIRegistry (com.google.javascript.rhino.TypeIRegistry)4 LinkedHashMap (java.util.LinkedHashMap)4 JSType (com.google.javascript.jscomp.newtypes.JSType)3 JSDocInfo (com.google.javascript.rhino.JSDocInfo)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 IdentityHashMap (java.util.IdentityHashMap)2 Map (java.util.Map)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 DiGraphNode (com.google.javascript.jscomp.graph.DiGraph.DiGraphNode)1 Visibility (com.google.javascript.rhino.JSDocInfo.Visibility)1 JSDocInfoBuilder (com.google.javascript.rhino.JSDocInfoBuilder)1 JSTypeExpression (com.google.javascript.rhino.JSTypeExpression)1 Token (com.google.javascript.rhino.Token)1 ArrayList (java.util.ArrayList)1