New issue
Advanced search Search tips

Issue 663878 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocking:
issue 405845



Sign in to add a comment

DevTools: console.table([1, 2, ...]) should show a table even when first argument has no array properties

Project Member Reported by l...@chromium.org, Nov 9 2016

Issue description

These show a table because some keys are 1+ dimensional:

console.table([{x: 1}])
console.table([[1]])

Today, these commands will not print any table, since their entries / values are zero dimensional:

console.table([1,2,3])
console.table({x: 1, y: 2})

This makes console.table useless for one dimensional data and leads to confusion.
We can still show a table for these cases if we wrap the first argument in an array.
 

Comment 1 by l...@chromium.org, Nov 9 2016

Blocking: 405845

Comment 2 by 4bra...@gmail.com, May 9 2017

The basic examples on MDN don't work in Chrome. Developers searching for how to use console.table will probably find MDN and be confused that it doesn't work.

https://developer.mozilla.org/en-US/docs/Web/API/Console/table

Comment 3 by l...@chromium.org, May 24 2017

Cc: l...@chromium.org
 Issue 725709  has been merged into this issue.

Comment 4 by l...@chromium.org, Jun 2 2017

Labels: -Pri-3 Pri-2
Status: Started (was: Assigned)
Before after screenshot:
http://imgur.com/a/c3afb
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 3 2017

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

commit f312e41ce160dcb406f68f41b7fa96232efcf48d
Author: luoe <luoe@chromium.org>
Date: Sat Jun 03 01:54:57 2017

DevTools: allow shallow array values in console.table

Today's console.table() implementation only looks at nested array values
`console.table([[1, 2, 3]])`. It ignores shallow array values, so commands such
as `console.table([1, 2, 3])` will not show anything.

To more closely align with the living standard supported in other browsers, this
CL finally brings supports to shallow values with a new 'Value' column.

Screenshot: http://imgur.com/a/c3afb

BUG= 663878 

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

[modify] https://crrev.com/f312e41ce160dcb406f68f41b7fa96232efcf48d/third_party/WebKit/LayoutTests/inspector/console/console-format-table-expected.txt
[modify] https://crrev.com/f312e41ce160dcb406f68f41b7fa96232efcf48d/third_party/WebKit/LayoutTests/inspector/console/console-format-table.html
[modify] https://crrev.com/f312e41ce160dcb406f68f41b7fa96232efcf48d/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Comment 6 by l...@chromium.org, Jun 5 2017

Status: Fixed (was: Started)

Sign in to add a comment