B2G/gecko/dom/mobilemessage/src/ril/MmsPduHelper.jsm
/**
   * Check existences of all mandatory fields of a MMS message. Also sets `type`
   * for convenient access.
   *
   * @param msg
   *        A MMS message object.
   *
   * @return The corresponding entry in MMS_PDU_TYPES;
   *
   * @throws FatalCodeError if the PDU type is not supported yet.
   */
Check existences of all mandatory fields of a MMS message. Also sets `type`
for convenient access.

@param msg
A MMS message object.

@return The corresponding entry in MMS_PDU_TYPES.

@throws FatalCodeError if the PDU type is not supported yet.
Check existences of all mandatory fields of a MMS message . Also sets ` type ` for convenient access . @param msg A MMS message object . @return The corresponding entry in MMS_PDU_TYPES . @throws FatalCodeError if the PDU type is not supported yet .
function checkMandatoryFields(msg) {
    let type = WSP.ensureHeader(msg.headers, "x-mms-message-type");
    let entry = MMS_PDU_TYPES[type];
    if (!entry) {
      throw new WSP.FatalCodeError(
        "checkMandatoryFields: unsupported message type " + type);
    }
    entry.mandatoryFields.forEach(function (name) {
      WSP.ensureHeader(msg.headers, name);
    });
    msg.type = type;
    return entry;
  }
function checkMandatoryFields ( msg ) { let type = WSP . ensureHeader ( msg . headers , "x-mms-message-type" ) ; let entry = MMS_PDU_TYPES [ type ] ; if ( ! entry ) { throw new WSP . FatalCodeError ( "checkMandatoryFields: unsupported message type " + type ) ; } entry . mandatoryFields . forEach ( function ( name ) { WSP . ensureHeader ( msg . headers , name ) ; } ) ; msg . type = type ; return entry ; }
Check existences of all mandatory fields of a MMS message.
Check existences of all mandatory fields of a MMS message .
// Setup convenient alias that referenced frequently.