B2G/gecko/services/metrics/dataprovider.jsm
/**
   * Validate that this instance is in conformance with the specification.
   *
   * This ensures all required fields are present. Field value validation
   * occurs when individual fields are set.
   */
Validate that this instance is in conformance with the specification.
This ensures all required fields are present. Field value validation
occurs when individual fields are set.
Validate that this instance is in conformance with the specification . This ensures all required fields are present . Field value validation occurs when individual fields are set .
function validate() {
    for (let field in this.fields) {
      let spec = this.fields[field];
      if (!spec.optional && !(field in this.values)) {
        throw new Error("Required field not defined: " + field);
      }
    }
  }
function validate ( ) { for ( let field in this . fields ) { let spec = this . fields [ field ] ; if ( ! spec . optional && ! ( field in this . values ) ) { throw new Error ( "Required field not defined: " + field ) ; } } }
Validate that this instance is in conformance with the specification.
Validate that this instance is in conformance with the specification .