Examples of FlowScope


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

    assertScopesDiffer(childA, childB);
    assertScopesDiffer(childA, childBC);
  }

  public void testDiffer2() {
    FlowScope childA = localEntry.createChildFlowScope();
    childA.inferSlotType("localA", NUMBER_TYPE);

    FlowScope childB = localEntry.createChildFlowScope();
    childB.inferSlotType("localA", NO_TYPE);

    assertScopesDiffer(childA, childB);
  }
View Full Code Here

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

  /**
   * Tests reverse interpretation of a EQ(NAME, NULL) expression.
   */
  @SuppressWarnings("unchecked")
  public void testEqCondition1() throws Exception {
    FlowScope blind = newScope();
    testBinop(blind,
        Token.EQ,
        createVar(blind, "a", createUnionType(BOOLEAN_TYPE, VOID_TYPE)),
        createNull(),
        Sets.newHashSet(new TypedName("a", VOID_TYPE)),
View Full Code Here

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

  /**
   * Tests reverse interpretation of a NE(NULL, NAME) expression.
   */
  @SuppressWarnings("unchecked")
  public void testEqCondition2() throws Exception {
    FlowScope blind = newScope();
    testBinop(blind,
        Token.NE,
        createNull(),
        createVar(blind, "a", createUnionType(BOOLEAN_TYPE, VOID_TYPE)),
        Sets.newHashSet(new TypedName("a", BOOLEAN_TYPE)),
View Full Code Here

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

  /**
   * Tests reverse interpretation of a EQ(NAME, NULL) expression.
   */
  @SuppressWarnings("unchecked")
  public void testEqCondition3() throws Exception {
    FlowScope blind = newScope();
    // (number,undefined,null)
    JSType nullableOptionalNumber =
        createUnionType(NULL_TYPE, VOID_TYPE, NUMBER_TYPE);
    // (null,undefined)
    JSType nullUndefined =
View Full Code Here

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

  /**
   * Tests reverse interpretation of two undefineds.
   */
  @SuppressWarnings("unchecked")
  public void testEqCondition4() throws Exception {
    FlowScope blind = newScope();
    testBinop(blind,
        Token.EQ,
        createVar(blind, "a", VOID_TYPE),
        createVar(blind, "b", VOID_TYPE),
        Sets.newHashSet(
View Full Code Here

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

   * where COMPARE can be LE, LT, GE or GT.
   */
  @SuppressWarnings("unchecked")
  public void testInequalitiesCondition1() {
    for (int op : Arrays.asList(Token.LT, Token.GT, Token.LE, Token.GE)) {
      FlowScope blind = newScope();
      testBinop(blind,
          op,
          createVar(blind, "a", createUnionType(STRING_TYPE, VOID_TYPE)),
          createNumber(8),
          Sets.newHashSet(
View Full Code Here

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

   * where COMPARE can be LE, LT, GE or GT.
   */
  @SuppressWarnings("unchecked")
  public void testInequalitiesCondition2() {
    for (int op : Arrays.asList(Token.LT, Token.GT, Token.LE, Token.GE)) {
      FlowScope blind = newScope();
      testBinop(blind,
          op,
          createVar(blind, "a",
              createUnionType(STRING_TYPE, NUMBER_TYPE, VOID_TYPE)),
          createVar(blind, "b",
View Full Code Here

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

   * where COMPARE can be LE, LT, GE or GT.
   */
  @SuppressWarnings("unchecked")
  public void testInequalitiesCondition3() {
    for (int op : Arrays.asList(Token.LT, Token.GT, Token.LE, Token.GE)) {
      FlowScope blind = newScope();
      testBinop(blind,
          op,
          createUntypedNumber(8),
          createVar(blind, "a", createUnionType(STRING_TYPE, VOID_TYPE)),
          Sets.newHashSet(
View Full Code Here

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

    }
  }

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

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

          createUnionType(STRING_TYPE, NULL_TYPE))));
  }

  @SuppressWarnings("unchecked")
  public void testTypeof1() {
    FlowScope blind = newScope();
    testBinop(blind,
        Token.EQ,
        new Node(Token.TYPEOF, createVar(blind, "a", OBJECT_TYPE)),
        Node.newString("function"),
        Sets.newHashSet(
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.