Chromium Code Reviews| 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) |