Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: webkit/glue/devtools/js/devtools.js

Issue 149341: DevTools: show property type names in Elements panel and Console (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/glue/devtools/js/inject.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/js/devtools.js
===================================================================
--- webkit/glue/devtools/js/devtools.js (revision 20134)
+++ webkit/glue/devtools/js/devtools.js (working copy)
@@ -562,20 +562,6 @@
/**
- * Dummy object used during properties inspection.
- * @see WebInspector.didGetNodePropertiesAsync_
- */
-WebInspector.dummyObject_ = { 'foo' : 'bar' };
-
-
-/**
- * Dummy function used during properties inspection.
- * @see WebInspector.didGetNodePropertiesAsync_
- */
-WebInspector.dummyFunction_ = function() {};
-
-
-/**
* Callback function used with the getNodeProperties.
*/
WebInspector.didGetNodePropertiesAsync_ = function(treeOutline, constructor,
@@ -585,23 +571,20 @@
var obj = {};
obj.devtools$$nodeId_ = nodeId;
obj.devtools$$path_ = path;
- for (var i = 0; i < props.length; i += 3) {
+ for (var i = 0; i < props.length; i += 4) {
var type = props[i];
var name = props[i + 1];
var value = props[i + 2];
+ var className = props[i + 3];
properties.push(name);
- if (type == 'object') {
+ if (type == 'object' || type == 'function') {
// fake object is going to be replaced on expand.
- obj[name] = WebInspector.dummyObject_;
- } else if (type == 'function') {
- // fake function is going to be replaced on expand.
- obj[name] = WebInspector.dummyFunction_;
+ obj[name] = new WebInspector.UnresolvedPropertyValue(type, className);
} else {
obj[name] = value;
}
}
properties.sort();
-
treeOutline.removeChildren();
for (var i = 0; i < properties.length; ++i) {
@@ -612,6 +595,17 @@
/**
+ * @param {string} type Type of the the property value('object' or 'function').
+ * @param {string} className Class name of the property value.
+ * @constructor
+ */
+WebInspector.UnresolvedPropertyValue = function(type, className) {
+ this.type = type;
+ this.className = className;
+};
+
+
+/**
* Replace WebKit method with our own implementation to use our call stack
* representation. Original method uses Object.prototype.toString.call to
* learn if scope object is a JSActivation which doesn't work in Chrome.
@@ -987,6 +981,10 @@
(function OverrideObjectDescribe() {
var oldDescribe = Object.describe;
Object.describe = function(obj, abbreviated) {
+ if (obj instanceof WebInspector.UnresolvedPropertyValue) {
+ return obj.className;
+ }
+
var result = oldDescribe.call(Object, obj, abbreviated);
if (result == 'Object' && obj.className) {
return obj.className;
« no previous file with comments | « no previous file | webkit/glue/devtools/js/inject.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698