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

Issue 2566443004: DevTools: merge array formatting logic (Closed)

Created:
4 years ago by luoe
Modified:
4 years ago
Reviewers:
lushnikov
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, pfeldman, kozyatinskiy+blink_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

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}

Patch Set 1 #

Total comments: 2

Patch Set 2 : test #

Total comments: 4

Patch Set 3 : ac #

Patch Set 4 : ac #

Patch Set 5 : ac #

Total comments: 4

Patch Set 6 : ac #

Patch Set 7 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -119 lines) Patch
M third_party/WebKit/LayoutTests/inspector/console/console-format-array-prototype-expected.txt View 1 2 1 chunk +10 lines, -10 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/console-format-collections-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/console-format-expected.txt View 1 2 3 4 5 6 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/console-log-object-with-getter-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/console-object-preview-expected.txt View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/console-save-to-temp-var-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/console-tainted-globals-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-inline-values-expected.txt View 1 2 5 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-save-to-temp-var-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js View 1 2 3 4 5 4 chunks +55 lines, -27 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js View 1 2 3 4 1 chunk +7 lines, -65 lines 0 comments Download

Messages

Total messages: 32 (21 generated)
luoe
Please take a look. https://codereview.chromium.org/2566443004/diff/1/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js File third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js (right): https://codereview.chromium.org/2566443004/diff/1/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js#newcode29 third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js:29: this._appendArrayPropertiesPreview(parentElement, preview, formatArrayByIndices); The plan ...
4 years ago (2016-12-08 22:36:45 UTC) #4
lushnikov
https://codereview.chromium.org/2566443004/diff/20001/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js File third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js (right): https://codereview.chromium.org/2566443004/diff/20001/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js#newcode83 third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js:83: _appendArrayPropertiesPreview(parentElement, preview, formatArrayByIndices) { let's not introduce one more ...
4 years ago (2016-12-08 23:23:09 UTC) #6
luoe
ptal, I've merged the two formats into one that includes information from both. A screenshot ...
4 years ago (2016-12-09 01:18:35 UTC) #8
lushnikov
lgtm https://codereview.chromium.org/2566443004/diff/80001/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js File third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js (right): https://codereview.chromium.org/2566443004/diff/80001/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js#newcode13 third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js:13: static objectPropertyComparator(a, b) { should it be private? ...
4 years ago (2016-12-12 22:10:43 UTC) #9
luoe
https://codereview.chromium.org/2566443004/diff/80001/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js File third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js (right): https://codereview.chromium.org/2566443004/diff/80001/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js#newcode13 third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js:13: static objectPropertyComparator(a, b) { On 2016/12/12 22:10:43, lushnikov wrote: ...
4 years ago (2016-12-13 03:57:35 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2566443004/100001
4 years ago (2016-12-13 17:51:51 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/324907)
4 years ago (2016-12-13 17:59:52 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2566443004/120001
4 years ago (2016-12-13 21:36:29 UTC) #26
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years ago (2016-12-13 21:49:28 UTC) #29
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/50c41a1483a808a3394581c717a18cf00773877e Cr-Commit-Position: refs/heads/master@{#438294}
4 years ago (2016-12-13 21:52:18 UTC) #31
luoe
4 years ago (2016-12-16 23:27:16 UTC) #32
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://codereview.chromium.org/2586623002/ by luoe@chromium.org.

The reason for reverting is: 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.

Powered by Google App Engine
This is Rietveld 408576698