Package com.google.javascript.jscomp.newtypes

Examples of com.google.javascript.jscomp.newtypes.EnumType


    private void visitNamespacePropertyDeclaration(
        Node declNode, Node recv, String pname) {
      Preconditions.checkArgument(
          declNode.isGetProp() || declNode.isStringKey());
      Preconditions.checkArgument(currentScope.isNamespace(recv));
      EnumType et = currentScope.getEnum(recv.getQualifiedName());
      // If there is a reassignment to one of the enum's members, don't consider
      // that a definition of a new property.
      if (et != null && et.enumLiteralHasKey(pname)) {
        return;
      }
      Namespace ns = currentScope.getNamespace(QualifiedName.fromNode(recv));
      JSDocInfo jsdoc = NodeUtil.getBestJSDocInfo(declNode);
      JSType propDeclType = getTypeAtPropDeclNode(declNode, jsdoc);
View Full Code Here


        }
        case Token.GETPROP:
          Node recv = n.getFirstChild();
          JSType recvType = simpleInferExprType(recv);
          if (recvType == null) {
            EnumType et = currentScope.getEnum(recv.getQualifiedName());
            if (et == null) {
              return null;
            }
            if (et.enumLiteralHasKey(n.getLastChild().getString())) {
              return et.getEnumeratedType();
            }
            return null;
          }
          QualifiedName qname = new QualifiedName(n.getLastChild().getString());
          if (!recvType.mayHaveProp(qname)) {
View Full Code Here

        return;
      }
      Node init = NodeUtil.getInitializer(qnameNode);
      // First check if the definition is an alias of a previous enum.
      if (init != null && init.isQualifiedName()) {
        EnumType et = currentScope.getEnum(init.getQualifiedName());
        if (et != null) {
          currentScope.addEnum(qnameNode, et);
          return;
        }
      }
View Full Code Here

TOP

Related Classes of com.google.javascript.jscomp.newtypes.EnumType

Copyright © 2018 www.massapicom. 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.