B2G/gecko/dom/mobilemessage/src/ril/MmsPduHelper.jsm
/**
   * @param data
   *        A wrapped object to store encoded raw data.
   * @param headers
   *        A dictionary object containing multiple name/value mapping.
   * @param name
   *        Name of the header field to be encoded.
   */
@param data
A wrapped object to store encoded raw data.
@param headers
A dictionary object containing multiple name/value mapping.
@param name
Name of the header field to be encoded.
@param data A wrapped object to store encoded raw data . @param headers A dictionary object containing multiple name / value mapping . @param name Name of the header field to be encoded .
function encodeHeader(data, headers, name) {
    let value = headers[name];
    if (Array.isArray(value)) {
      for (let i = 0; i < value.length; i++) {
        HeaderField.encode(data, {name: name, value: value[i]}, headers);
      }
    } else {
      HeaderField.encode(data, {name: name, value: value}, headers);
    }
  }
function encodeHeader ( data , headers , name ) { let value = headers [ name ] ; if ( Array . isArray ( value ) ) { for ( let i = 0 ; i < value . length ; i ++ ) { HeaderField . encode ( data , { name : name , value : value [ i ] } , headers ) ; } } else { HeaderField . encode ( data , { name : name , value : value } , headers ) ; } }
@param data
        A wrapped object to store encoded raw data.
@param data A wrapped object to store encoded raw data .