New issue
Advanced search Search tips

Issue 915109 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 18
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

console.assert did not use formater

Reported by justja...@gmail.com, Dec 14

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce the problem:
console.assert(false, 'foo %i bar', 3)

What is the expected behavior?

What went wrong?
// in Chrome
Assertion failed: foo %i bar 3

// in Node.js 10.13.0
Assertion failed: foo 3 bar

// in FF 64.0
Assertion failed: foo 3 bar

// in Edge 42.17134.1.0
foo 3 bar

// in IE 11.407.17134.0
foo 3 bar

Did this work before? No 

Chrome version: 73.0.3639.0  Channel: canary
OS Version: 10.0
Flash Version: 32.0.0.105
 
Devtools documentation misleadingly doesn't explicitly indicate it's not possible:
https://developers.google.com/web/tools/chrome-devtools/console/console-write#string_substitution_and_formatting

    > The first parameter passed to any of the logging methods may contain one or more format specifiers. 

The definition specifies only one object parameter unlike console.log and others,
https://developers.google.com/web/tools/chrome-devtools/console/console-reference#assert

    > console.assert(expression, object)

So it looks like Chrome never implemented and this issue may be considered a feature request. Previously it was declined in 2014 for no reason ( bug 163675 ), but it's 2018 now and it'd be weird not to implement it, especially since it seems to be implemented everywhere else.
Components: -Platform>DevTools Platform>DevTools>JavaScript
Owner: pfeldman@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 18

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

commit 5d4834321266c9975f5bc8f5cefa6f6d192fb0db
Author: Pavel Feldman <pfeldman@chromium.org>
Date: Tue Dec 18 02:09:13 2018

DevTools: use message format in console.assert.

Bug:  915109 
Change-Id: I3b501780c51e4ab226db9c40c8afff6edfcb1471
Reviewed-on: https://chromium-review.googlesource.com/c/1380548
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617345}
[modify] https://crrev.com/5d4834321266c9975f5bc8f5cefa6f6d192fb0db/third_party/blink/renderer/devtools/front_end/console/ConsoleViewMessage.js

Status: Fixed (was: Unconfirmed)

Sign in to add a comment