New issue
Advanced search Search tips

Issue 675259 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 0
Type: Bug-Regression



Sign in to add a comment

DevTools: array formatting is broken, shows undefined x n when there are real values

Project Member Reported by l...@chromium.org, Dec 16 2016

Issue description

Console previews lie when logging an array

In the console, evaluate:
var b = new Array(200);
b.fill(2);
console.log(b);

Actual: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, undefined × 100…]

Expected: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2…]

There are actual values after the first 100, but console shows undefined x 100.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/631b841680800d7ea174cc898a4f0c5884111b91

commit 631b841680800d7ea174cc898a4f0c5884111b91
Author: luoe <luoe@chromium.org>
Date: Sat Dec 17 02:17:58 2016

Revert of DevTools: merge array formatting logic (patchset #7 id:120001 of https://codereview.chromium.org/2566443004/ )

Reason for revert:
Console previews for arrays have been compromised.  When logging an array with 100+ non-empty properties, the overflow properties (after the first 100 in the preview) show up as 'undefined x N' when they are not undefined.

Repro case:
var b = new Array(200);
b.fill(2);
console.log(b);

 crbug.com/675259 

Original issue's description:
> DevTools: merge array formatting logic
>
> This CL makes array formatting consistent and prepares
> RemoteObjectPreviewFormatter (ROPF) to introduce character cutoff logic.
> Today, array formatting is split between two files. The logic in
> ConsoleViewMessage has been folded into ROPF.js with all arrays showing gaps
> with 'undefined x n' as much as possible then falling back to 'key: value'.
>
> For background on character cutoff logic, see C1 in the console preview doc.
>
> BUG= 666882 
>
> Committed: https://crrev.com/50c41a1483a808a3394581c717a18cf00773877e
> Cr-Commit-Position: refs/heads/master@{#438294}

TBR=lushnikov@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 675259 

Review-Url: https://codereview.chromium.org/2586623002
Cr-Commit-Position: refs/heads/master@{#439286}

[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/console/console-format-array-prototype-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/console/console-format-collections-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/console/console-format-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/console/console-log-object-with-getter-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/console/console-object-preview-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/console/console-save-to-temp-var-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/console/console-tainted-globals-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-inline-values-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-save-to-temp-var-expected.txt
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
[modify] https://crrev.com/631b841680800d7ea174cc898a4f0c5884111b91/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Comment 2 by l...@chromium.org, Dec 19 2016

Status: Fixed (was: Assigned)

Sign in to add a comment