Examples of JSType


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

    verify("out1", startType);
    verifySubtypeOf("out2", FUNCTION_INSTANCE_TYPE);
  }

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

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

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

  public void testAssertElement() {
    JSType elementType = registry.createObjectType("Element", null,
        registry.getNativeObjectType(OBJECT_TYPE));
    assuming("x", elementType);
    inFunction("out1 = x; goog.asserts.assertElement(x); out2 = x;");
    verify("out1", elementType);
  }
View Full Code Here

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

    inFunction("out1 = x; goog.asserts.assertElement(x); out2 = x;");
    verify("out1", elementType);
  }

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

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

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

  public void testAssertObject3() {
    JSType startType = createNullableType(OBJECT_TYPE);
    assuming("x.y", startType);
    inFunction("out1 = x.y; goog.asserts.assertObject(x.y); out2 = x.y;");
    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 testAssertObject4() {
    JSType startType = createNullableType(ARRAY_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; out2 = goog.asserts.assertObject(x);");
    verify("out1", startType);
    verify("out2", ARRAY_TYPE);
  }
View Full Code Here

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

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

  public void testAssertObject5() {
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction(
        "out1 = x;" +
        "out2 = /** @type {!Array} */ (goog.asserts.assertObject(x));");
    verify("out1", startType);
View Full Code Here

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

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

  public void testAssertArray() {
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; goog.asserts.assertArray(x); out2 = x;");
    verify("out1", startType);
    verifySubtypeOf("out2", ARRAY_TYPE);
  }
View Full Code Here

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

    verifySubtypeOf("out2", ARRAY_TYPE);
  }

  public void testAssertInstanceof1() {
    // Test invalid assert (2 params are required)
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; goog.asserts.assertInstanceof(x); out2 = x;");
    verify("out1", startType);
    verify("out2", UNKNOWN_TYPE);
  }
View Full Code Here

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

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

  public void testAssertInstanceof2() {
    JSType startType = createNullableType(ALL_TYPE);
    assuming("x", startType);
    inFunction("out1 = x; goog.asserts.assertInstanceof(x, String); out2 = x;");
    verify("out1", startType);
    verify("out2", STRING_OBJECT_TYPE);
  }
View Full Code Here

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

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

  public void testAssertInstanceof3() {
    JSType unknownType = registry.getNativeType(UNKNOWN_TYPE);
    JSType startType = registry.getNativeType(STRING_TYPE);
    assuming("x", startType);
    assuming("Foo", unknownType);
    inFunction("out1 = x; goog.asserts.assertInstanceof(x, Foo); out2 = x;");
    verify("out1", startType);
    verify("out2", UNKNOWN_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.