B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   *
   * @return Decoded integer value.
   *
   * @throws CodeError if the first octet read is larger than 31.
   */
@param data
A wrapped object containing raw PDU data.

@return Decoded integer value.

@throws CodeError if the first octet read is larger than 31.
@param data A wrapped object containing raw PDU data . @return Decoded integer value . @throws CodeError if the first octet read is larger than 31 .
function decode(data) {
    let value = Octet.decode(data);
    if (value <= 30) {
      return value;
    }
    if (value == 31) {
      return UintVar.decode(data);
    }
    throw new CodeError("Value-length: invalid value " + value);
  }
function decode ( data ) { let value = Octet . decode ( data ) ; if ( value <= 30 ) { return value ; } if ( value == 31 ) { return UintVar . decode ( data ) ; } throw new CodeError ( "Value-length: invalid value " + value ) ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .