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 884af2c0c76778351bf61a79af790ad9ff386d42..44007078fd193f6dbd8affa017cc711c314fba13 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js |
| @@ -463,7 +463,7 @@ Console.ConsoleViewMessage = class { |
| switch (type) { |
| case 'array': |
| case 'typedarray': |
| - element = this._formatParameterAsArray(output); |
| + element = this._formatParameterAsObject(output, includePreview); |
| break; |
| case 'error': |
| element = this._formatParameterAsError(output); |
| @@ -618,82 +618,6 @@ Console.ConsoleViewMessage = class { |
| } |
| /** |
| - * @param {!SDK.RemoteObject} array |
| - * @return {!Element} |
| - */ |
| - _formatParameterAsArray(array) { |
| - var usePrintedArrayFormat = this._message.type !== SDK.ConsoleMessage.MessageType.DirXML && |
| - this._message.type !== SDK.ConsoleMessage.MessageType.Result; |
| - var isLongArray = array.arrayLength() > 100; |
| - if (usePrintedArrayFormat || isLongArray) |
| - return this._formatParameterAsObject(array, usePrintedArrayFormat || !isLongArray); |
| - var result = createElement('span'); |
| - array.getAllProperties(false, printArrayResult.bind(this)); |
|
dgozman
2016/12/28 00:40:36
Let's investigate how to trigger this, because the
luoe
2016/12/28 22:21:56
It turns out that this does get triggered in a str
|
| - return result; |
| - |
| - /** |
| - * @param {?Array.<!SDK.RemoteObjectProperty>} properties |
| - * @this {!Console.ConsoleViewMessage} |
| - */ |
| - function printArrayResult(properties) { |
| - if (!properties) { |
| - result.appendChild(this._formatParameterAsObject(array, false)); |
| - 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); |
| - } |
| - } |
| - |
| - /** |
| * @param {!SDK.RemoteObject} output |
| * @return {!Element} |
| */ |