DevTools: console.table([1, 2, ...]) should show a table even when first argument has no array properties |
|||
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.
,
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
,
May 24 2017
,
Jun 2 2017
Before after screenshot: http://imgur.com/a/c3afb
,
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
,
Jun 5 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by l...@chromium.org
, Nov 9 2016