B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Go up/down the history stack of input values.
   *
   * @param number aDirection
   *        History navigation direction: HISTORY_BACK or HISTORY_FORWARD.
   *
   * @returns boolean
   *          True if the input value changed, false otherwise.
   */
Go up/down the history stack of input values.
@param number aDirection
History navigation direction: HISTORY_BACK or HISTORY_FORWARD.

@returns boolean
True if the input value changed, false otherwise.
Go up / down the history stack of input values . @param number aDirection History navigation direction : HISTORY_BACK or HISTORY_FORWARD . @returns boolean True if the input value changed false otherwise .
function JST_historyPeruse(aDirection)
  {
    if (!this.history.length) {
      return false;
    }
    if (aDirection == HISTORY_BACK) {
      if (this.historyPlaceHolder <= 0) {
        return false;
      }
      let inputVal = this.history[--this.historyPlaceHolder];
      if (inputVal){
        this.setInputValue(inputVal);
      }
    }
    else if (aDirection == HISTORY_FORWARD) {
      if (this.historyPlaceHolder == this.history.length - 1) {
        this.historyPlaceHolder ++;
        this.setInputValue("");
      }
      else if (this.historyPlaceHolder >= (this.history.length)) {
        return false;
      }
      else {
        let inputVal = this.history[++this.historyPlaceHolder];
        if (inputVal){
          this.setInputValue(inputVal);
        }
      }
    }
    else {
      throw new Error("Invalid argument 0");
    }
    return true;
  }
function JST_historyPeruse ( aDirection ) { if ( ! this . history . length ) { return false ; } if ( aDirection == HISTORY_BACK ) { if ( this . historyPlaceHolder <= 0 ) { return false ; } let inputVal = this . history [ -- this . historyPlaceHolder ] ; if ( inputVal ) { this . setInputValue ( inputVal ) ; } } else if ( aDirection == HISTORY_FORWARD ) { if ( this . historyPlaceHolder == this . history . length - 1 ) { this . historyPlaceHolder ++ ; this . setInputValue ( "" ) ; } else if ( this . historyPlaceHolder >= ( this . history . length ) ) { return false ; } else { let inputVal = this . history [ ++ this . historyPlaceHolder ] ; if ( inputVal ) { this . setInputValue ( inputVal ) ; } } } else { throw new Error ( "Invalid argument 0" ) ; } return true ; }
Go up/down the history stack of input values.
Go up / down the history stack of input values .
// Up Arrow key // Down Arrow key