Index: Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js |
=================================================================== |
--- Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js (revision 76938) |
+++ Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js (working copy) |
@@ -26,6 +26,8 @@ |
WebInspector.ScopeChainSidebarPane = function() |
{ |
WebInspector.SidebarPane.call(this, WebInspector.UIString("Scope Variables")); |
+ this._sections = []; |
+ this._expandedSections = {}; |
this._expandedProperties = []; |
} |
@@ -34,9 +36,6 @@ |
{ |
this.bodyElement.removeChildren(); |
- this.sections = []; |
- this.callFrame = callFrame; |
- |
if (!callFrame) { |
var infoElement = document.createElement("div"); |
infoElement.className = "info"; |
@@ -45,6 +44,18 @@ |
return; |
} |
+ for (var i = 0; i < this._sections.length; ++i) { |
+ var section = this._sections[i]; |
+ if (!section.title) |
+ continue; |
+ if (section.expanded) |
+ this._expandedSections[section.title] = true; |
+ else |
+ delete this._expandedSections[section.title]; |
+ } |
+ |
+ this._sections = []; |
+ |
var foundLocalScope = false; |
var scopeChain = callFrame.scopeChain; |
for (var i = 0; i < scopeChain.length; ++i) { |
@@ -81,10 +92,10 @@ |
section.editInSelectedCallFrameWhenPaused = true; |
section.pane = this; |
- if (!foundLocalScope || scopeObjectProxy.isLocal) |
+ if (!foundLocalScope || scopeObjectProxy.isLocal || title in this._expandedSections) |
section.expanded = true; |
- this.sections.push(section); |
+ this._sections.push(section); |
this.bodyElement.appendChild(section.element); |
} |
} |