B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object to store encoded raw data.
   * @param value
   *        An integer value.
   */
@param data
A wrapped object to store encoded raw data.
@param value
An integer value.
@param data A wrapped object to store encoded raw data . @param value An integer value .
function encode(data, value) {
    if (value < 0) {
      throw new CodeError("UintVar: invalid value " + value);
    }
    let stack = [];
    while (value >= 128) {
      stack.push(Math.floor(value % 128));
      value = Math.floor(value / 128);
    }
    while (stack.length) {
      Octet.encode(data, value | 0x80);
      value = stack.pop();
    }
    Octet.encode(data, value);
  }
function encode ( data , value ) { if ( value < 0 ) { throw new CodeError ( "UintVar: invalid value " + value ) ; } let stack = [ ] ; while ( value >= 128 ) { stack . push ( Math . floor ( value % 128 ) ) ; value = Math . floor ( value / 128 ) ; } while ( stack . length ) { Octet . encode ( data , value | 0x80 ) ; value = stack . pop ( ) ; } Octet . encode ( data , value ) ; }
@param data
        A wrapped object to store encoded raw data.
@param data A wrapped object to store encoded raw data .