Package com.google.javascript.jscomp.GlobalTypeInfo

Examples of com.google.javascript.jscomp.GlobalTypeInfo.Scope


    }
    return env;
  }

  private void collectTypesForFreeVarsFwd(Node callee, TypeEnv env) {
    Scope calleeScope = currentScope.getScope(callee.getQualifiedName());
    for (String freeVar : calleeScope.getOuterVars()) {
      if (calleeScope.getDeclaredTypeOf(freeVar) == null) {
        FunctionType summary = summaries.get(calleeScope).getFunType();
        JSType outerType = envGetType(env, freeVar);
        JSType innerType = summary.getOuterVarPrecondition(freeVar);
        if (outerType != null && JSType.meet(outerType, innerType).isBottom()) {
          warnings.add(JSError.make(callee, CROSS_SCOPE_GOTCHA,
View Full Code Here


      }
    }
  }

  private TypeEnv collectTypesForFreeVarsBwd(Node callee, TypeEnv env) {
    Scope calleeScope = currentScope.getScope(callee.getQualifiedName());
    for (String freeVar : calleeScope.getOuterVars()) {
      if (!currentScope.isDefinedLocally(freeVar) &&
          !currentScope.isOuterVar(freeVar)) {
        continue;
      }
      // Practice will inform what the right decision here is.
View Full Code Here

    // Local function definitions will be type-checked more
    // exactly using their summaries, and don't need deferred checks
    if (currentScope.isKnownFunction(calleeName)
        && !currentScope.isLocalFunDef(calleeName)
        && !currentScope.isExternalFunction(calleeName)) {
      Scope s = currentScope.getScope(calleeName);
      JSType expectedRetType;
      if (s.getDeclaredType().getReturnType() == null) {
        expectedRetType = requiredType;
      } else {
        // No deferred check if the return type is declared
        expectedRetType = null;
      }
View Full Code Here

TOP

Related Classes of com.google.javascript.jscomp.GlobalTypeInfo.Scope

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.