B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object to store encoded raw data.
   * @param text
   *        String text of one character to be encoded.
   *
   * @throws CodeError if a control character got.
   */
@param data
A wrapped object to store encoded raw data.
@param text
String text of one character to be encoded.

@throws CodeError if a control character got.
@param data A wrapped object to store encoded raw data . @param text String text of one character to be encoded . @throws CodeError if a control character got .
function encode(data, text) {
    if (!text) {
      throw new CodeError("Text: empty string");
    }
    let code = text.charCodeAt(0);
    if ((code < CTLS) || (code == DEL) || (code > 255)) {
      throw new CodeError("Text: invalid char code " + code);
    }
    Octet.encode(data, code);
  }
function encode ( data , text ) { if ( ! text ) { throw new CodeError ( "Text: empty string" ) ; } let code = text . charCodeAt ( 0 ) ; if ( ( code < CTLS ) || ( code == DEL ) || ( code > 255 ) ) { throw new CodeError ( "Text: invalid char code " + code ) ; } Octet . encode ( data , code ) ; }
@param data
        A wrapped object to store encoded raw data.
@param data A wrapped object to store encoded raw data .