Examples of FlowScope


Examples of com.google.javascript.jscomp.type.FlowScope

            new TypedName("b", STRING_TYPE)));
  }

  @SuppressWarnings("unchecked")
  public void testShneCondition4() throws Exception {
    FlowScope blind = newScope();
    testBinop(blind,
        Token.SHNE,
        createVar(blind, "a", createUnionType(STRING_TYPE, VOID_TYPE)),
        createVar(blind, "b", createUnionType(VOID_TYPE)),
        Sets.newHashSet(new TypedName("a", STRING_TYPE),
View Full Code Here

Examples of com.google.javascript.jscomp.type.FlowScope

            new TypedName("b", VOID_TYPE)));
  }

  @SuppressWarnings("unchecked")
  public void testShneCondition5() throws Exception {
    FlowScope blind = newScope();
    testBinop(blind,
        Token.SHNE,
        createVar(blind, "a", createUnionType(NULL_TYPE, VOID_TYPE)),
        createVar(blind, "b", createUnionType(NULL_TYPE)),
        Sets.newHashSet(new TypedName("a", VOID_TYPE),
View Full Code Here

Examples of com.google.javascript.jscomp.type.FlowScope

            new TypedName("b", NULL_TYPE)));
  }

  @SuppressWarnings("unchecked")
  public void testShneCondition6() throws Exception {
    FlowScope blind = newScope();
    testBinop(blind,
        Token.SHNE,
        createVar(blind, "a", createUnionType(STRING_TYPE, VOID_TYPE)),
        createVar(blind, "b", createUnionType(NUMBER_TYPE, VOID_TYPE)),
        Sets.newHashSet(
View Full Code Here

Examples of com.google.javascript.jscomp.type.FlowScope

    Node n = compiler.parseTestCode("var a; " + function + "(a)");
    Node call = n.getLastChild().getLastChild();
    Node name = call.getLastChild();

    Scope scope = new SyntacticScopeCreator(compiler).createScope(n, null);
    FlowScope flowScope = LinkedFlowScope.createEntryLattice(scope);

    assertEquals(Token.CALL, call.getType());
    assertEquals(Token.NAME, name.getType());

    GoogleCodingConvention convention = new GoogleCodingConvention();
    flowScope.inferSlotType("a", type);
    ClosureReverseAbstractInterpreter rai =
        new ClosureReverseAbstractInterpreter(convention, registry);

    // trueScope
    Asserts.assertTypeEquals(
View Full Code Here

Examples of com.google.javascript.jscomp.type.FlowScope

    // want to infer anything about this scope.
    if (input == bottomScope) {
      return input;
    }

    FlowScope output = input.createChildFlowScope();
    output = traverse(n, output);
    return output;
  }
View Full Code Here

Examples of com.google.javascript.jscomp.type.FlowScope

    // NOTE(nicksantos): Right now, we just treat ON_EX edges like UNCOND
    // edges. If we wanted to be perfect, we'd actually JOIN all the out
    // lattices of this flow with the in lattice, and then make that the out
    // lattice for the ON_EX edge. But it's probably too expensive to be
    // worthwhile.
    FlowScope output = flowThrough(source, input);
    Node condition = null;
    FlowScope conditionFlowScope = null;
    BooleanOutcomePair conditionOutcomes = null;

    List<DiGraphEdge<Node, Branch>> branchEdges = getCfg().getOutEdges(source);
    List<FlowScope> result = Lists.newArrayListWithCapacity(branchEdges.size());
    for (DiGraphEdge<Node, Branch> branchEdge : branchEdges) {
      Branch branch = branchEdge.getValue();
      FlowScope newScope = output;

      switch (branch) {
        case ON_TRUE:
          if (NodeUtil.isForIn(source)) {
            // item is assigned a property name, so its type should be string.
            Node item = source.getFirstChild();
            Node obj = item.getNext();

            FlowScope informed = traverse(obj, output.createChildFlowScope());

            if (item.isVar()) {
              item = item.getFirstChild();
            }
            if (item.isName()) {
View Full Code Here

Examples of com.google.javascript.jscomp.type.FlowScope

    // verify the condition
    scope = traverse(condition, scope);

    // reverse abstract interpret the condition to produce two new scopes
    FlowScope trueScope = reverseInterpreter.
        getPreciserScopeKnowingConditionOutcome(
            condition, scope, true);
    FlowScope falseScope = reverseInterpreter.
        getPreciserScopeKnowingConditionOutcome(
            condition, scope, false);

    // traverse the true node with the trueScope
    traverse(trueNode, trueScope.createChildFlowScope());

    // traverse the false node with the falseScope
    traverse(falseNode, falseScope.createChildFlowScope());

    // meet true and false nodes' types and assign
    JSType trueType = trueNode.getJSType();
    JSType falseType = falseNode.getJSType();
    if (trueType != null && falseType != null) {
View Full Code Here

Examples of com.google.javascript.jscomp.type.FlowScope

        left, scope.createChildFlowScope());
    JSType leftType = left.getJSType();

    // reverse abstract interpret the left node to produce the correct
    // scope in which to verify the right node
    FlowScope rightScope = reverseInterpreter.
        getPreciserScopeKnowingConditionOutcome(left,
            leftOutcome.getOutcomeFlowScope(left.getType(), nIsAnd),
            nIsAnd);

    // type the right node
    BooleanOutcomePair rightOutcome = traverseWithinShortCircuitingBinOp(
        right, rightScope.createChildFlowScope());
    JSType rightType = right.getJSType();

    JSType type;
    BooleanOutcomePair outcome;
    if (leftType != null && rightType != null) {
View Full Code Here

Examples of org.springframework.webflow.scope.FlowScope

    flowContext.setDisplayName("Flow ApplicationContext [" + getContext().getFlowId() + "]");
    flowContext.setParent(parent);
    flowContext.getBeanFactory().registerScope("request", new RequestScope());
    flowContext.getBeanFactory().registerScope("flash", new FlashScope());
    flowContext.getBeanFactory().registerScope("view", new ViewScope());
    flowContext.getBeanFactory().registerScope("flow", new FlowScope());
    flowContext.getBeanFactory().registerScope("conversation", new ConversationScope());
    Resource flowResource = flowModelHolder.getFlowModelResource();
    flowContext.setResourceLoader(new FlowRelativeResourceLoader(flowResource));
    if (JdkVersion.isAtLeastJava15()) {
      AnnotationConfigUtils.registerAnnotationConfigProcessors(flowContext);
View Full Code Here

Examples of org.springframework.webflow.scope.FlowScope

    flowContext.setDisplayName("Flow ApplicationContext [" + getContext().getFlowId() + "]");
    flowContext.setParent(parent);
    flowContext.getBeanFactory().registerScope("request", new RequestScope());
    flowContext.getBeanFactory().registerScope("flash", new FlashScope());
    flowContext.getBeanFactory().registerScope("view", new ViewScope());
    flowContext.getBeanFactory().registerScope("flow", new FlowScope());
    flowContext.getBeanFactory().registerScope("conversation", new ConversationScope());
    Resource flowResource = flowModelHolder.getFlowModelResource();
    flowContext.setResourceLoader(new FlowRelativeResourceLoader(flowResource));
    AnnotationConfigUtils.registerAnnotationConfigProcessors(flowContext);
    new XmlBeanDefinitionReader(flowContext).loadBeanDefinitions(resources);
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.