B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * The callback used for updating the Property Panel when the user clicks the
   * Update button.
   *
   * @private
   * @param object aOptions
   *        The options object used for opening the initial Property Panel.
   * @param object aPropPanel
   *        The Property Panel instance.
   * @param object aOldResponse
   *        The previous JSTerm:EvalResult message received from the content
   *        process.
   * @param object aNewResponse
   *        The new JSTerm:EvalResult message received after the user clicked
   *        the Update button.
   */
The callback used for updating the Property Panel when the user clicks the
Update button.

@private
@param object aOptions
The options object used for opening the initial Property Panel.
@param object aPropPanel
The Property Panel instance.
@param object aOldResponse
The previous JSTerm:EvalResult message received from the content
process.
@param object aNewResponse
The new JSTerm:EvalResult message received after the user clicked
the Update button.
The callback used for updating the Property Panel when the user clicks the Update button . @private @param object aOptions The options object used for opening the initial Property Panel . @param object aPropPanel The Property Panel instance . @param object aOldResponse The previous JSTerm : EvalResult message received from the content process . @param object aNewResponse The new JSTerm : EvalResult message received after the user clicked the Update button .
function JST__updatePanelCallback(aOptions, aPropPanel, aOldResponse,
                                    aNewResponse)
  {
    if (aNewResponse.errorMessage) {
      this.writeOutput(aNewResponse.errorMessage, CATEGORY_OUTPUT,
                       SEVERITY_ERROR);
      return;
    }
    let result = aNewResponse.result;
    let inspectable = result && typeof result == "object" && result.inspectable;
    let newActor = result && typeof result == "object" ? result.actor : null;
    let anchor = aOptions.anchor;
    if (anchor && newActor) {
      if (!anchor._objectActors) {
        anchor._objectActors = [];
      }
      if (anchor._objectActors.indexOf(newActor) == -1) {
        anchor._objectActors.push(newActor);
      }
    }
    if (!inspectable) {
      this.writeOutput(l10n.getStr("JSTerm.updateNotInspectable"), CATEGORY_OUTPUT, SEVERITY_ERROR);
      return;
    }
    aOldResponse.result = aNewResponse.result;
    aOldResponse.error = aNewResponse.error;
    aOldResponse.errorMessage = aNewResponse.errorMessage;
    aOldResponse.timestamp = aNewResponse.timestamp;
    this.hud.objectPropertiesProvider(newActor,
      function _onObjectProperties(aProperties) {
        aOptions.data.objectProperties = aProperties;
        aPropPanel.treeView.data = aOptions.data;
      }.bind(this));
  }
function JST__updatePanelCallback ( aOptions , aPropPanel , aOldResponse , aNewResponse ) { if ( aNewResponse . errorMessage ) { this . writeOutput ( aNewResponse . errorMessage , CATEGORY_OUTPUT , SEVERITY_ERROR ) ; return ; } let result = aNewResponse . result ; let inspectable = result && typeof result == "object" && result . inspectable ; let newActor = result && typeof result == "object" ? result . actor : null ; let anchor = aOptions . anchor ; if ( anchor && newActor ) { if ( ! anchor . _objectActors ) { anchor . _objectActors = [ ] ; } if ( anchor . _objectActors . indexOf ( newActor ) == - 1 ) { anchor . _objectActors . push ( newActor ) ; } } if ( ! inspectable ) { this . writeOutput ( l10n . getStr ( "JSTerm.updateNotInspectable" ) , CATEGORY_OUTPUT , SEVERITY_ERROR ) ; return ; } aOldResponse . result = aNewResponse . result ; aOldResponse . error = aNewResponse . error ; aOldResponse . errorMessage = aNewResponse . errorMessage ; aOldResponse . timestamp = aNewResponse . timestamp ; this . hud . objectPropertiesProvider ( newActor , function _onObjectProperties ( aProperties ) { aOptions . data . objectProperties = aProperties ; aPropPanel . treeView . data = aOptions . data ; } . bind ( this ) ) ; }
The callback used for updating the Property Panel when the user clicks the
 Update button.
The callback used for updating the Property Panel when the user clicks the Update button .
// Update the old response object such that when the panel is reopen, the // user sees the new response. // TODO: This updates the value of the tree. // However, the states of open nodes is not saved. // See bug 586246.