Package com.google.javascript.jscomp.newtypes

Examples of com.google.javascript.jscomp.newtypes.JSType.specialize()


              receiver.isName() ? receiver.getString() : null,
              recvType.getDeclaredProp(propQname),
              resultType, requiredType)) {
        // Tighten the inferred type and don't warn.
        // See Token.NAME fwd for explanation about types as lower/upper bounds.
        resultType = resultType.specialize(requiredType);
        LValueResultFwd lvr =
            analyzeLValueFwd(propAccessNode, inEnv, resultType);
        TypeEnv updatedEnv =
            updateLvalueTypeInEnv(lvr.env, propAccessNode, lvr.ptr, resultType);
        return new EnvTypePair(updatedEnv, resultType);
View Full Code Here


      if (insideQualifiedName && lvalueType.isLoose()) {
        // For loose objects, create the inner property if it doesn't exist.
        lvalueType = lvalueType.withProperty(
            pname, JSType.TOP_OBJECT.withLoose());
        if (lvalueType.isDict() && propAccessNode.isGetProp()) {
          lvalueType = lvalueType.specialize(JSType.TOP_STRUCT);
        } else if (lvalueType.isStruct() && propAccessNode.isGetElem()) {
          lvalueType = lvalueType.specialize(JSType.TOP_DICT);
        }
        lvalueEnv = updateLvalueTypeInEnv(
            lvalueEnv, obj, lvalue.ptr, lvalueType);
View Full Code Here

        lvalueType = lvalueType.withProperty(
            pname, JSType.TOP_OBJECT.withLoose());
        if (lvalueType.isDict() && propAccessNode.isGetProp()) {
          lvalueType = lvalueType.specialize(JSType.TOP_STRUCT);
        } else if (lvalueType.isStruct() && propAccessNode.isGetElem()) {
          lvalueType = lvalueType.specialize(JSType.TOP_DICT);
        }
        lvalueEnv = updateLvalueTypeInEnv(
            lvalueEnv, obj, lvalue.ptr, lvalueType);
      } else {
        // Warn for inexistent prop either on the non-top-level of a qualified
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.