B2G/gecko/browser/devtools/scratchpad/scratchpad.js
/**
   * Close the scratchpad window. Prompts before closing if the scratchpad
   * has unsaved changes.
   *
   * @param function aCallback
   *        Optional function you want to call when file is saved
   */
Close the scratchpad window. Prompts before closing if the scratchpad
has unsaved changes.

@param function aCallback
Optional function you want to call when file is saved
Close the scratchpad window . Prompts before closing if the scratchpad has unsaved changes . @param function aCallback Optional function you want to call when file is saved
function SP_close(aCallback)
  {
    this.promptSave(function(aShouldClose, aSaved, aStatus) {
      let shouldClose = aShouldClose;
      if (aSaved && !Components.isSuccessCode(aStatus)) {
        shouldClose = false;
      }
      if (shouldClose) {
        this._skipClosePrompt = true;
        window.close();
      }
      if (aCallback) {
        aCallback();
      }
    }.bind(this));
  }
function SP_close ( aCallback ) { this . promptSave ( function ( aShouldClose , aSaved , aStatus ) { let shouldClose = aShouldClose ; if ( aSaved && ! Components . isSuccessCode ( aStatus ) ) { shouldClose = false ; } if ( shouldClose ) { this . _skipClosePrompt = true ; window . close ( ) ; } if ( aCallback ) { aCallback ( ) ; } } . bind ( this ) ) ; }
Close the scratchpad window.
Close the scratchpad window .