Examples of toMaybeEnumType()


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

    JSType valueType = getJSType(value);
    if (!valueType.isEnumType()) {
      return;
    }

    EnumType valueEnumType = valueType.toMaybeEnumType();
    JSType valueEnumPrimitiveType =
        valueEnumType.getElementsType().getPrimitiveType();
    validator.expectCanAssignTo(t, value, valueEnumPrimitiveType,
        declInfo.getEnumParameterType().evaluate(t.getScope(), typeRegistry),
        "incompatible enum element types");
View Full Code Here

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

      return "";
    } else if (type.isFunctionType()) {
      return getFunctionAnnotation(node);
    } else if (type.isEnumType()) {
      return "/** @enum {" +
          type.toMaybeEnumType().getElementsType().toAnnotationString() +
          "} */\n";
    } else if (!type.isUnknownType()
        && !type.isEmptyType()
        && !type.isVoidType()
        && !type.isFunctionPrototypeType()) {
View Full Code Here

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

            && rawType.isFunctionType() && rawType.isNominalConstructor()) {
          return rawType.toMaybeFunctionType().getInstanceType();
        }
        // Case enum
        if (rawType.isEnumType()) {
          return rawType.toMaybeEnumType().getElementsType();
        }
      }
      // Case typedef
      JSDocInfo info = slot.getJSDocInfo();
      if (info != null && info.hasTypedefType()) {
View Full Code Here

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

        }
        providedJsType = providedJsType.restrictByNotNullOrUndefined();

        JSType jsType = node.getJSType();
        return jsType != null && jsType.isEnumType() && providedJsType.isEquivalentTo(
            jsType.toMaybeEnumType().getElementsType().getPrimitiveType());
      }
    };
  }

  /**
 
View Full Code Here

Examples of com.google.javascript.rhino.jstype.ObjectType.toMaybeEnumType()

    }

    // Enums
    if (type.isEnumType() &&
        sym.getName().equals(
            type.toMaybeEnumType().getElementsType().getReferenceName())) {
      return true;
    }

    return false;
  }
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.