B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   *
   * @return Decoded string value.
   *
   * @throws CodeError if decoded application id number is an array.
   * @throws NotWellKnownEncodingError if decoded well-known application id
   *         number is not registered or supported.
   */
@param data
A wrapped object containing raw PDU data.

@return Decoded string value.

@throws CodeError if decoded application id number is an array.
@throws NotWellKnownEncodingError if decoded well-known application id
number is not registered or supported.
@param data A wrapped object containing raw PDU data . @return Decoded string value . @throws CodeError if decoded application id number is an array . @throws NotWellKnownEncodingError if decoded well - known application id number is not registered or supported .
function decode(data) {
    let begin = data.offset;
    try {
      return UriValue.decode(data);
    } catch (e) {}
    data.offset = begin;
    let numOrArray = IntegerValue.decode(data);
    if (typeof numOrArray != "number") {
      throw new CodeError("Application-id-value: invalid integer type");
    }
    let id = numOrArray;
    let entry = OMNA_PUSH_APPLICATION_IDS[id];
    if (!entry) {
      throw new NotWellKnownEncodingError(
        "Application-id-value: not well known id: " + id);
    }
    return entry.urn;
  }
function decode ( data ) { let begin = data . offset ; try { return UriValue . decode ( data ) ; } catch ( e ) { } data . offset = begin ; let numOrArray = IntegerValue . decode ( data ) ; if ( typeof numOrArray != "number" ) { throw new CodeError ( "Application-id-value: invalid integer type" ) ; } let id = numOrArray ; let entry = OMNA_PUSH_APPLICATION_IDS [ id ] ; if ( ! entry ) { throw new NotWellKnownEncodingError ( "Application-id-value: not well known id: " + id ) ; } return entry . urn ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .
// `decodeIntegerValue` can return a array, which doesn't apply here.