New issue
Advanced search Search tips

Issue 751850 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug-Regression



Sign in to add a comment

DevTools: fix console %o formatting for arrays

Project Member Reported by l...@chromium.org, Aug 2 2017

Issue description

See:
https://github.com/nodejs/node/pull/14558#issuecomment-319724976

The idea is that %o and %O specifiers on console.log() should map to console.log and console.dir formatters, respectively.

Currently, we need to update
`console.log('%o', [1,2,3])`

To format as `[1, 2, 3]` instead of `Array(3)`
 

Comment 1 by l...@chromium.org, Aug 9 2017

beforeAfterObjectOptimalSpecifier.png
29.3 KB View Download

Comment 2 by l...@chromium.org, Sep 28 2017

Labels: -Type-Bug Type-Bug-Regression
For reference, I've bisected this regression to an old commit of mine:
https://chromium.googlesource.com/chromium/src/+/05dd76a462c939c4dcdcce29cf29f10943ace9f9%5E%21
Project Member

Comment 3 by bugdroid1@chromium.org, Sep 29 2017

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

commit 71d5ed5b2493fc0d5a32211b2d6bd8b770bc8cf7
Author: Erik Luo <luoe@chromium.org>
Date: Fri Sep 29 08:50:39 2017

DevTools: align console %o optimal formatting specifier with spec

The console spec says that the %o specifier should produce
"optimally useful formatting" as opposed to the %O
"generic JavaScript object formatting". To make this distinction clearer
and align log() to %o and dir() to %O, this CL will format
arrays/objects with previews when using %o.

Please see crbug for screenshot.

Bug:  751850 
Change-Id: I927e1c34667f1d11bc13e98a86d38419b7012940
Reviewed-on: https://chromium-review.googlesource.com/607576
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505333}
[modify] https://crrev.com/71d5ed5b2493fc0d5a32211b2d6bd8b770bc8cf7/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-message-format-expected.txt
[modify] https://crrev.com/71d5ed5b2493fc0d5a32211b2d6bd8b770bc8cf7/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-message-format.js
[modify] https://crrev.com/71d5ed5b2493fc0d5a32211b2d6bd8b770bc8cf7/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Comment 4 by l...@chromium.org, Sep 30 2017

Status: Fixed (was: Assigned)

Sign in to add a comment