Package com.google.javascript.rhino.jstype.RecordTypeBuilder

Examples of com.google.javascript.rhino.jstype.RecordTypeBuilder.RecordProperty


    super(registry, null, null);
    setPrettyPrint(true);
    this.declared = declared;

    for (String property : properties.keySet()) {
      RecordProperty prop = properties.get(property);
      if (prop == null) {
        throw new IllegalStateException(
            "RecordProperty associated with a property should not be null!");
      }
      if (declared) {
        defineDeclaredProperty(
            property, prop.getType(), prop.getPropertyNode());
      } else {
        defineSynthesizedProperty(
            property, prop.getType(), prop.getPropertyNode());
      }
    }

    // Freeze the record type.
    isFrozen = true;
View Full Code Here


   * {@link JSTypeRegistry#createRecordType}.
   */
  public void testCreateRecordType() throws Exception {
    Map<String, RecordProperty> properties =
        new HashMap<String, RecordProperty>();
    properties.put("hello", new RecordProperty(NUMBER_TYPE, null));

    JSType recordType = registry.createRecordType(properties);
    assertEquals("{hello: number}", recordType.toString());
  }
View Full Code Here

   */
  RecordType(JSTypeRegistry registry, Map<String, RecordProperty> properties) {
    super(registry, null, null);

    for (String property : properties.keySet()) {
      RecordProperty prop = properties.get(property);
      if (prop == null) {
        throw new IllegalStateException(
            "RecordProperty associated with a property should not be null!");
      }
      defineDeclaredProperty(property, prop.getType(), prop.getPropertyNode());
    }

    // Freeze the record type.
    isFrozen = true;
  }
View Full Code Here

   * {@link JSTypeRegistry#createRecordType}.
   */
  public void testCreateRecordType() throws Exception {
    Map<String, RecordProperty> properties =
        new HashMap<String, RecordProperty>();
    properties.put("hello", new RecordProperty(NUMBER_TYPE, null));

    JSType recordType = registry.createRecordType(properties);
    assertEquals("{hello: number}", recordType.toString());
  }
View Full Code Here

TOP

Related Classes of com.google.javascript.rhino.jstype.RecordTypeBuilder.RecordProperty

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.