summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 13:29:25 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 13:29:25 +0000
commit8e54f00c38057765306445c4ad946fd6c51ced59 (patch)
tree44557df1d915390482d92521bd3b5c4444227733 /webkit
parent0c8e77459b6d7f8a2a8773c4da934ccdf08a2bce (diff)
downloadchromium_src-8e54f00c38057765306445c4ad946fd6c51ced59.zip
chromium_src-8e54f00c38057765306445c4ad946fd6c51ced59.tar.gz
chromium_src-8e54f00c38057765306445c4ad946fd6c51ced59.tar.bz2
DevTools: Implement console.dir(live object) while on a breakpoint.
Review URL: http://codereview.chromium.org/131030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/devtools/js/devtools.js45
1 files changed, 41 insertions, 4 deletions
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js
index cb7c362..7e03b06 100644
--- a/webkit/glue/devtools/js/devtools.js
+++ b/webkit/glue/devtools/js/devtools.js
@@ -656,6 +656,36 @@ WebInspector.ScopeChainSidebarPane.prototype.update = function(callFrame) {
/**
+ * Our implementation of ObjectPropertiesSection for resolved values.
+ * @constructor
+ */
+WebInspector.ScopeChainPropertiesSection = function(object, title) {
+ WebInspector.ObjectPropertiesSection.call(this, object, title,
+ null /* subtitle */, null /* emptyPlaceholder */,
+ true /* ignoreHasOwnProperty */, null /* extraProperties */,
+ WebInspector.ScopeChainSidebarPane.TreeElement);
+};
+goog.inherits(WebInspector.ScopeChainPropertiesSection,
+ WebInspector.ObjectPropertiesSection);
+
+
+/**
+ * @override
+ */
+WebInspector.ScopeChainPropertiesSection.prototype.onpopulate = function() {
+ var treeOutline = this.propertiesTreeOutline;
+ devtools.tools.getDebuggerAgent().resolveChildren(this.object,
+ function(object) {
+ for (var name in object.resolvedValue) {
+ treeOutline.appendChild(new
+ WebInspector.ScopeChainSidebarPane.TreeElement(
+ object.resolvedValue, name));
+ }
+ });
+};
+
+
+/**
* Custom implementation of TreeElement that asynchronously resolves children
* using the debugger agent.
* @constructor
@@ -903,9 +933,16 @@ Object.sortedProperties = function(obj) {
WebInspector.Console.prototype._formatobject = function(object, elem) {
- var wrapper = {};
- wrapper.id_ = object.___devtools_id;
- wrapper.protoDepth_ = -1;
- var section = new WebInspector.SidebarObjectPropertiesSection(wrapper, null);
+ var section;
+ if (object.handle && object.className) {
+ object.ref = object.handle;
+ section = new WebInspector.ScopeChainPropertiesSection(object,
+ object.className);
+ } else {
+ var wrapper = {};
+ wrapper.id_ = object.___devtools_id;
+ wrapper.protoDepth_ = -1;
+ section = new WebInspector.SidebarObjectPropertiesSection(wrapper, null);
+ }
elem.appendChild(section.element);
};