Package com.google.javascript.rhino.jstype

Examples of com.google.javascript.rhino.jstype.JSType.toObjectType()


        JSType type = n.getFirstChild().getJSType();
        if (type == null || type.toObjectType() == null) {
          // Note cases like <primitive>.field
          return;
        }
        removeProperty(type.toObjectType(), propName);
      }
      if (n.getJSDocInfo() != null) {
        n.getJSDocInfo().setAssociatedNode(null);
      }
    }
View Full Code Here


      }
    }

    String qualifiedName = n.getQualifiedName();
    if (type.isFunctionPrototypeType() ||
        (type.toObjectType() != null &&
         type.toObjectType().getConstructor() != null)) {
      return type.toString();
    } else if (qualifiedName != null) {
      return qualifiedName;
    } else if (type.isFunctionType()) {
View Full Code Here

    }

    String qualifiedName = n.getQualifiedName();
    if (type.isFunctionPrototypeType() ||
        (type.toObjectType() != null &&
         type.toObjectType().getConstructor() != null)) {
      return type.toString();
    } else if (qualifiedName != null) {
      return qualifiedName;
    } else if (type.isFunctionType()) {
      // Don't show complex function names.
View Full Code Here

      Set<JSType> types = Sets.newHashSet();
      JSType skipType = type;
      while (skipType != null) {
        types.add(skipType);

        ObjectType objSkipType = skipType.toObjectType();
        if (objSkipType != null) {
          skipType = objSkipType.getImplicitPrototype();
        } else {
          break;
        }
View Full Code Here

    if (existingType != null) {
      boolean isInstanceObject = existingType.isInstanceType();
      if (isInstanceObject || fnName.equals("Function")) {
        FunctionType existingFn =
            isInstanceObject ?
            existingType.toObjectType().getConstructor() :
            typeRegistry.getNativeFunctionType(FUNCTION_FUNCTION_TYPE);

        if (existingFn.getSource() == null) {
          existingFn.setSource(sourceNode);
        }
View Full Code Here

        break;

      case Token.OBJECTLIT:
        if ((expr.getJSType() != null) && !expr.getJSType().isUnknownType()) {
          JSType exprType = expr.getJSType().restrictByNotNullOrUndefined();
          ConcreteType inst = createConcreteInstance(exprType.toObjectType());
          allInstantiatedTypes.add(inst);
          ret = inst;
        } else {
          ret = ConcreteType.ALL;
        }
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.