B2G/gecko/dom/mobilemessage/src/ril/MmsPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   * @param msg [optional]
   *        Optional target object for decoding.
   *
   * @return A MMS message object or null in case of errors found.
   */
@param data
A wrapped object containing raw PDU data.
@param msg [optional]
Optional target object for decoding.

@return A MMS message object or null in case of errors found.
@param data A wrapped object containing raw PDU data . @param msg [ optional ] Optional target object for decoding . @return A MMS message object or null in case of errors found .
function parse(data, msg) {
    if (!msg) {
      msg = {};
    }
    try {
      msg.headers = this.parseHeaders(data, msg.headers);
      let typeinfo = this.checkMandatoryFields(msg);
      if (typeinfo.hasContent) {
        this.parseContent(data, msg);
      }
    } catch (e) {
      debug("Failed to parse MMS message, error message: " + e.message);
      return null;
    }
    return msg;
  }
function parse ( data , msg ) { if ( ! msg ) { msg = { } ; } try { msg . headers = this . parseHeaders ( data , msg . headers ) ; let typeinfo = this . checkMandatoryFields ( msg ) ; if ( typeinfo . hasContent ) { this . parseContent ( data , msg ) ; } } catch ( e ) { debug ( "Failed to parse MMS message, error message: " + e . message ) ; return null ; } return msg ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .
// Validity checks