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

Unified Diff: Source/core/inspector/InjectedScriptSource.js

Issue 317703003: DevTools: Show internal properties in object preview in console. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « LayoutTests/inspector/console/console-format-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScriptSource.js
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index b60be3e95288e365eddde8188f7fb2b7acba3747..1dfeb2f63d6b62e96a729f4bbb61321d1dbee8aa 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -1094,7 +1094,7 @@ InjectedScript.RemoteObject = function(object, objectGroupName, forceValueType,
this.description = injectedScript._describe(object);
if (generatePreview && (this.type === "object" || injectedScript._isHTMLAllCollection(object)))
- this.preview = this._generatePreview(object, undefined, columnNames, isTable, false);
+ this.preview = this._generatePreview(object, undefined, columnNames, isTable);
}
InjectedScript.RemoteObject.prototype = {
@@ -1103,10 +1103,9 @@ InjectedScript.RemoteObject.prototype = {
* @param {Array.<string>=} firstLevelKeys
* @param {?Array.<string>=} secondLevelKeys
* @param {boolean=} isTable
- * @param {boolean=} isTableRow
* @return {!RuntimeAgent.ObjectPreview} preview
*/
- _generatePreview: function(object, firstLevelKeys, secondLevelKeys, isTable, isTableRow)
+ _generatePreview: function(object, firstLevelKeys, secondLevelKeys, isTable)
{
var preview = { __proto__: null };
preview.lossless = true;
@@ -1116,12 +1115,13 @@ InjectedScript.RemoteObject.prototype = {
var firstLevelKeysCount = firstLevelKeys ? firstLevelKeys.length : 0;
var propertiesThreshold = {
- properties: (isTable || isTableRow) ? 1000 : max(5, firstLevelKeysCount),
- indexes: (isTable || isTableRow) ? 1000 : max(100, firstLevelKeysCount)
+ properties: isTable ? 1000 : max(5, firstLevelKeysCount),
+ indexes: isTable ? 1000 : max(100, firstLevelKeysCount)
};
try {
var descriptors = injectedScript._propertyDescriptors(object);
+ var internalProperties;
if (firstLevelKeys) {
var nameToDescriptors = { __proto__: null };
@@ -1134,11 +1134,23 @@ InjectedScript.RemoteObject.prototype = {
descriptors[i] = nameToDescriptors["#" + firstLevelKeys[i]];
}
- for (var i = 0; i < descriptors.length; ++i) {
+ for (var i = 0, n = descriptors.length + 1; i < n; ++i) {
if (propertiesThreshold.indexes < 0 || propertiesThreshold.properties < 0)
break;
var descriptor = descriptors[i];
+ if (i >= descriptors.length && !isTable) {
+ // Add internal properties to preview.
+ if (!internalProperties) {
+ internalProperties = InjectedScriptHost.getInternalProperties(object) || [];
+ n = descriptors.length + internalProperties.length;
+ if (i >= n)
+ break;
+ }
+ descriptor = nullifyObjectProto(internalProperties[i - descriptors.length]);
+ descriptor.enumerable = true;
+ }
+
if (!descriptor)
yurys 2014/06/06 09:12:01 Let's try to extract common part into a separate m
aandrey 2014/06/06 09:28:41 Done.
continue;
if (descriptor.wasThrown) {
@@ -1183,7 +1195,7 @@ InjectedScript.RemoteObject.prototype = {
}
if (secondLevelKeys === null || secondLevelKeys) {
- var subPreview = this._generatePreview(value, secondLevelKeys || undefined, undefined, false, isTable);
+ var subPreview = this._generatePreview(value, secondLevelKeys || undefined, undefined, isTable);
var property = { name: name, type: type, valuePreview: subPreview, __proto__: null };
this._appendPropertyPreview(preview, property, propertiesThreshold);
if (!subPreview.lossless)
« no previous file with comments | « LayoutTests/inspector/console/console-format-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698