Examples of restrictByNotNullOrUndefined()


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

    if (parameterType.isUnknownType()) {
      typeString = "*";
    } else {
      // Fix-up optional and vararg parameters to match JSDoc type language
      if (parameterNode.isOptionalArg()) {
        typeString = parameterType.restrictByNotNullOrUndefined() + "=";
      } else if (parameterNode.isVarArgs()) {
        typeString = "..." + parameterType.restrictByNotNullOrUndefined();
      } else {
        typeString = parameterType.toString();
      }
View Full Code Here

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

    } else {
      // Fix-up optional and vararg parameters to match JSDoc type language
      if (parameterNode.isOptionalArg()) {
        typeString = parameterType.restrictByNotNullOrUndefined() + "=";
      } else if (parameterNode.isVarArgs()) {
        typeString = "..." + parameterType.restrictByNotNullOrUndefined();
      } else {
        typeString = parameterType.toString();
      }
    }
View Full Code Here

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

    } else {
      JSType found = instance.getPropertyType(prop);
      JSType required
        = implementedInterface.getImplicitPrototype().getPropertyType(prop);
      found = found.restrictByNotNullOrUndefined();
      required = required.restrictByNotNullOrUndefined();
      if (!found.canAssignTo(required)) {
        // Implemented, but not correctly typed
        FunctionType constructor
          = implementedInterface.toObjectType().getConstructor();
        registerMismatch(found, required, report(t.makeError(n,
View Full Code Here

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

        if (info != null && info.hasType()) {
          JSType type = info.getType().evaluate(scope, typeRegistry);

          // Known to be not null since we have the FUNCTION token there.
          type = type.restrictByNotNullOrUndefined();
          if (type.isFunctionType()) {
            functionType = type.toMaybeFunctionType();
            functionType.setJSDocInfo(info);
          }
        }
View Full Code Here

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

    private ObjectType getObjectSlot(String slotName) {
      Var ownerVar = scope.getVar(slotName);
      if (ownerVar != null) {
        JSType ownerVarType = ownerVar.getType();
        return ObjectType.cast(ownerVarType == null ?
            null : ownerVarType.restrictByNotNullOrUndefined());
      }
      return null;
    }

    /**
 
View Full Code Here

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

      } else {
        parameterType = typeRegistry.getNativeType(UNKNOWN_TYPE);
      }

      if (templateTypeName != null &&
          parameterType.restrictByNotNullOrUndefined().isTemplateType()) {
        if (foundTemplateType) {
          reportError(TEMPLATE_TYPE_DUPLICATED, fnName);
        }
        foundTemplateType = true;
      }
View Full Code Here

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

        return compiler.getTypeRegistry().getNativeType(
            JSTypeNative.UNKNOWN_TYPE);
      }
    }
    // Null-ability does not affect the name graph's result.
    return type.restrictByNotNullOrUndefined();
  }

  /**
   * Mark the provided node as the current function that we are analyzing.
   * and add it to the stack of scopes we are inside.
View Full Code Here

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

   */
  private void ensurePropertyDefined(Node getprop, JSType rightType) {
    String propName = getprop.getLastChild().getString();
    JSType nodeType = getJSType(getprop.getFirstChild());
    ObjectType objectType = ObjectType.cast(
        nodeType.restrictByNotNullOrUndefined());
    if (objectType == null) {
      registry.registerPropertyOnType(propName, nodeType);
    } else {
      if (ensurePropertyDeclaredHelper(getprop, objectType)) {
        return;
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.