B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   *
   * @return A decoded object containing `name` and `value` properties or null
   *         if something wrong. The `name` property must be a string, but the
   *         `value` property can be many different types depending on `name`.
   */
@param data
A wrapped object containing raw PDU data.

@return A decoded object containing `name` and `value` properties or null
if something wrong.
@param data A wrapped object containing raw PDU data . @return A decoded object containing ` name ` and ` value ` properties or null if something wrong .
function decodeUntypedParameter(data) {
    let name = TokenText.decode(data);
    let begin = data.offset, value;
    try {
      value = decodeAlternatives(data, null, IntegerValue, TextValue);
    } catch (e) {
      data.offset = begin;
      value = skipValue(data);
      debug("Skip malformed untyped parameter: "
            + JSON.stringify({name: name, value: value}));
      return null;
    }
    return {
      name: name.toLowerCase(),
      value: value,
    };
  }
function decodeUntypedParameter ( data ) { let name = TokenText . decode ( data ) ; let begin = data . offset , value ; try { value = decodeAlternatives ( data , null , IntegerValue , TextValue ) ; } catch ( e ) { data . offset = begin ; value = skipValue ( data ) ; debug ( "Skip malformed untyped parameter: " + JSON . stringify ( { name : name , value : value } ) ) ; return null ; } return { name : name . toLowerCase ( ) , value : value , } ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .
// Skip current parameter.