B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Execute a string. Execution happens asynchronously in the content process.
   *
   * @param string [aExecuteString]
   *        The string you want to execute. If this is not provided, the current
   *        user input is used - taken from |this.inputNode.value|.
   * @param function [aCallback]
   *        Optional function to invoke when the result is displayed.
   */
Execute a string. Execution happens asynchronously in the content process.
@param string [aExecuteString]
The string you want to execute. If this is not provided, the current
user input is used - taken from |this.inputNode.value|.
@param function [aCallback]
Optional function to invoke when the result is displayed.
Execute a string . Execution happens asynchronously in the content process . @param string [ aExecuteString ] The string you want to execute . If this is not provided the current user input is used - taken from |this . inputNode . value| . @param function [ aCallback ] Optional function to invoke when the result is displayed .
function JST_execute(aExecuteString, aCallback)
  {
    aExecuteString = aExecuteString || this.inputNode.value;
    if (!aExecuteString) {
      this.writeOutput("no value to execute", CATEGORY_OUTPUT, SEVERITY_LOG);
      return;
    }
    let node = this.writeOutput(aExecuteString, CATEGORY_INPUT, SEVERITY_LOG);
    let onResult = this._executeResultCallback.bind(this, node, aCallback);
    this.webConsoleClient.evaluateJS(aExecuteString, onResult);
    this.history.push(aExecuteString);
    this.historyIndex++;
    this.historyPlaceHolder = this.history.length;
    this.setInputValue("");
    this.clearCompletion();
  }
function JST_execute ( aExecuteString , aCallback ) { aExecuteString = aExecuteString || this . inputNode . value ; if ( ! aExecuteString ) { this . writeOutput ( "no value to execute" , CATEGORY_OUTPUT , SEVERITY_LOG ) ; return ; } let node = this . writeOutput ( aExecuteString , CATEGORY_INPUT , SEVERITY_LOG ) ; let onResult = this . _executeResultCallback . bind ( this , node , aCallback ) ; this . webConsoleClient . evaluateJS ( aExecuteString , onResult ) ; this . history . push ( aExecuteString ) ; this . historyIndex ++ ; this . historyPlaceHolder = this . history . length ; this . setInputValue ( "" ) ; this . clearCompletion ( ) ; }
Execute a string.
Execute a string .
// attempt to execute the content of the inputNode