Examples of JSType


Examples of com.google.javascript.rhino.jstype.JSType

    verify("out1", startType);
    verify("out2", OBJECT_TYPE);
  }

  public void testAssert7() {
    JSType startType = createNullableType(OBJECT_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; out2 = goog.asserts.assert(x);");
    verify("out1", startType);
    verify("out2", OBJECT_TYPE);
  }
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out1", startType);
    verify("out2", OBJECT_TYPE);
  }

  public void testAssert8() {
    JSType startType = createNullableType(OBJECT_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; out2 = goog.asserts.assert(x != null);");
    verify("out1", startType);
    verify("out2", BOOLEAN_TYPE);
  }
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out1", startType);
    verify("out2", BOOLEAN_TYPE);
  }

  public void testAssert9() {
    JSType startType = createNullableType(NUMBER_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; out2 = goog.asserts.assert(y = x);");
    verify("out1", startType);
    verify("out2", NUMBER_TYPE);
  }
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out1", startType);
    verify("out2", NUMBER_TYPE);
  }

  public void testAssert10() {
    JSType startType = createNullableType(OBJECT_TYPE);
    assuming("x", startType);
    assuming("y", startType);
    inFunction("out1 = x; out2 = goog.asserts.assert(x && y); out3 = x;");
    verify("out1", startType);
    verify("out2", OBJECT_TYPE);
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out2", OBJECT_TYPE);
    verify("out3", OBJECT_TYPE);
  }

  public void testAssert11() {
    JSType startType = createNullableType(OBJECT_TYPE);
    assuming("x", startType);
    assuming("y", startType);
    inFunction("var z = goog.asserts.assert(x || y);");
    verify("x", startType);
    verify("y", startType);
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("x", startType);
    verify("y", startType);
  }

  public void testAssertNumber() {
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; goog.asserts.assertNumber(x); out2 = x;");
    verify("out1", startType);
    verify("out2", NUMBER_TYPE);
  }
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out2", NUMBER_TYPE);
  }

  public void testAssertNumber2() {
    // Make sure it ignores expressions.
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("goog.asserts.assertNumber(x + x); out1 = x;");
    verify("out1", startType);
  }
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out1", startType);
  }

  public void testAssertNumber3() {
    // Make sure it ignores expressions.
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; out2 = goog.asserts.assertNumber(x + x);");
    verify("out1", startType);
    verify("out2", NUMBER_TYPE);
  }
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out1", startType);
    verify("out2", NUMBER_TYPE);
  }

  public void testAssertString() {
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; goog.asserts.assertString(x); out2 = x;");
    verify("out1", startType);
    verify("out2", STRING_TYPE);
  }
View Full Code Here

Examples of com.google.javascript.rhino.jstype.JSType

    verify("out1", startType);
    verify("out2", STRING_TYPE);
  }

  public void testAssertFunction() {
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; goog.asserts.assertFunction(x); out2 = x;");
    verify("out1", startType);
    verifySubtypeOf("out2", FUNCTION_INSTANCE_TYPE);
  }
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.