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

Unified Diff: third_party/WebKit/Source/devtools/front_end/object_ui/RemoteObjectPreviewFormatter.js

Issue 2723773003: DevTools: restore array lengths for long arrays (Closed)
Patch Set: Created 3 years, 10 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
Index: third_party/WebKit/Source/devtools/front_end/object_ui/RemoteObjectPreviewFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/object_ui/RemoteObjectPreviewFormatter.js b/third_party/WebKit/Source/devtools/front_end/object_ui/RemoteObjectPreviewFormatter.js
index cc2234f9a834ff8b48616fec293d7e3fd8c1f0d4..5e5a94713c5f9162432605473854f874407d6e07 100644
--- a/third_party/WebKit/Source/devtools/front_end/object_ui/RemoteObjectPreviewFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/object_ui/RemoteObjectPreviewFormatter.js
@@ -32,20 +32,16 @@ ObjectUI.RemoteObjectPreviewFormatter = class {
}
const isArrayOrTypedArray = preview.subtype === 'array' || preview.subtype === 'typedarray';
if (description) {
- if (previewExperimentEnabled) {
- // Hide the description for plain objects and plain arrays.
- const plainObjectDescription = 'Object';
- const size = SDK.RemoteObject.arrayLength(preview) || SDK.RemoteObject.mapOrSetEntriesCount(preview);
- var text = preview.subtype === 'typedarray' ? SDK.RemoteObject.arrayNameFromDescription(description) : '';
- if (isArrayOrTypedArray)
- text += size > 1 ? ('(' + size + ')') : '';
- else
- text = description === plainObjectDescription ? '' : description;
- if (text.length > 0)
- parentElement.createChild('span', 'object-description').textContent = text + ' ';
- } else if (preview.subtype !== 'array') {
- parentElement.createTextChildren(description, ' ');
+ const size = SDK.RemoteObject.arrayLength(preview) || SDK.RemoteObject.mapOrSetEntriesCount(preview);
lushnikov 2017/02/28 22:21:08 value of mapOrSetEntriesCount is never used the v
luoe 2017/02/28 22:32:57 Done.
+ var text = preview.subtype === 'typedarray' ? SDK.RemoteObject.arrayNameFromDescription(description) : '';
lushnikov 2017/02/28 22:21:08 this should go under isArrayOrTypedArray as well
luoe 2017/02/28 22:32:57 Done.
+ if (isArrayOrTypedArray) {
+ text += size > 1 ? ('(' + size + ')') : '';
+ } else {
+ var hideObjectKeyword = previewExperimentEnabled && description === 'Object';
lushnikov 2017/02/28 22:21:08 hideDescription?
luoe 2017/02/28 22:32:57 Done.
+ text = hideObjectKeyword ? '' : description;
}
+ if (text.length > 0)
+ parentElement.createChild('span', 'object-description').textContent = text + ' ';
}
parentElement.createTextChild(isArrayOrTypedArray ? '[' : '{');

Powered by Google App Engine
This is Rietveld 408576698