Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js |
| index 73aedc4e179d8c807b396adce17e0a2844e34dd4..04c493ccf8529d7da6d10f2305a41cbe0dde4a68 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js |
| @@ -624,70 +624,12 @@ Console.ConsoleViewMessage = class { |
| var isLongArray = array.arrayLength() > 100; |
| if (usePrintedArrayFormat || isLongArray) |
| return this._formatParameterAsObject(array, usePrintedArrayFormat || !isLongArray); |
| - var result = createElement('span'); |
| - array.getAllProperties(false, printArrayResult.bind(this)); |
| - return result; |
| - |
| - /** |
| - * @param {?Array.<!SDK.RemoteObjectProperty>} properties |
| - * @this {!Console.ConsoleViewMessage} |
| - */ |
| - function printArrayResult(properties) { |
| - if (!properties) { |
| - result.appendChild(this._formatParameterAsObject(array, false)); |
|
lushnikov
2016/12/08 23:23:09
what happened to this logic?
luoe
2016/12/09 01:18:35
Good call. We used to fallback to the description
|
| - return; |
| - } |
| - |
| - var titleElement = createElementWithClass('span', 'console-object-preview'); |
| - if (array.subtype === 'typedarray') |
| - titleElement.createTextChild(array.description + ' '); |
| - var elements = {}; |
| - for (var i = 0; i < properties.length; ++i) { |
| - var property = properties[i]; |
| - var name = property.name; |
| - if (isNaN(name)) |
| - continue; |
| - if (property.getter) |
| - elements[name] = this._formatAsAccessorProperty(array, [name], true); |
| - else if (property.value) |
| - elements[name] = this._formatAsArrayEntry(property.value); |
| - } |
| - |
| - titleElement.createTextChild('['); |
| - var lastNonEmptyIndex = -1; |
| - |
| - function appendUndefined(titleElement, index) { |
| - if (index - lastNonEmptyIndex <= 1) |
| - return; |
| - var span = titleElement.createChild('span', 'object-value-undefined'); |
| - span.textContent = Common.UIString('undefined × %d', index - lastNonEmptyIndex - 1); |
| - } |
| - |
| - var length = array.arrayLength(); |
| - for (var i = 0; i < length; ++i) { |
| - var element = elements[i]; |
| - if (!element) |
| - continue; |
| - |
| - if (i - lastNonEmptyIndex > 1) { |
| - appendUndefined(titleElement, i); |
| - titleElement.createTextChild(', '); |
| - } |
| - |
| - titleElement.appendChild(element); |
| - lastNonEmptyIndex = i; |
| - if (i < length - 1) |
| - titleElement.createTextChild(', '); |
| - } |
| - appendUndefined(titleElement, length); |
| - |
| - titleElement.createTextChild(']'); |
| - |
| - var section = new Components.ObjectPropertiesSection(array, titleElement, this._linkifier); |
| - section.element.classList.add('console-view-object-properties-section'); |
| - section.enableContextMenu(); |
| - result.appendChild(section.element); |
| - } |
| + var titleElement = createElementWithClass('span', 'console-object-preview'); |
| + this._previewFormatter.appendObjectPreview(titleElement, array.preview, true); |
| + var section = new Components.ObjectPropertiesSection(array, titleElement, this._linkifier); |
| + section.element.classList.add('console-view-object-properties-section'); |
| + section.enableContextMenu(); |
| + return section.element; |
| } |
| /** |