B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   *
   * @return A field name string.
   *
   * @throws NotWellKnownEncodingError if decoded well-known header field
   *         number is not registered or supported.
   */
@param data
A wrapped object containing raw PDU data.

@return A field name string.

@throws NotWellKnownEncodingError if decoded well-known header field
number is not registered or supported.
@param data A wrapped object containing raw PDU data . @return A field name string . @throws NotWellKnownEncodingError if decoded well - known header field number is not registered or supported .
function decode(data) {
    let begin = data.offset;
    try {
      return TokenText.decode(data).toLowerCase();
    } catch (e) {}
    data.offset = begin;
    let number = ShortInteger.decode(data);
    let entry = WSP_HEADER_FIELDS[number];
    if (!entry) {
      throw new NotWellKnownEncodingError(
        "Field-name: not well known encoding " + number);
    }
    return entry.name;
  }
function decode ( data ) { let begin = data . offset ; try { return TokenText . decode ( data ) . toLowerCase ( ) ; } catch ( e ) { } data . offset = begin ; let number = ShortInteger . decode ( data ) ; let entry = WSP_HEADER_FIELDS [ number ] ; if ( ! entry ) { throw new NotWellKnownEncodingError ( "Field-name: not well known encoding " + number ) ; } return entry . name ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .