New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 700626 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 696805
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

console.count() label toString conversion exhibits odd behavior

Project Member Reported by domfarolino@gmail.com, Mar 11 2017

Issue description

Chrome Version       : 56.0.2924.87
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari: FAIL
    Firefox: FAIL
       Edge: FAIL
         IE: N/A

What steps will reproduce the problem?
(1) [OPTIONAL] Read up on the issue here: https://github.com/whatwg/console/issues/88
(2) Open DevTools on any page
(3) Run the code from the following jsbin in the console: https://jsbin.com/kibefuj/edit?js,console.

What is the expected result?

It is expected that a timer's label will computed using `label.toString()` if the label is an object, therefore code inside `label.toString()` will be invoked. An exception should be thrown, propagated to the user, and no counter will be incremented.

What happens instead?

The label's toString() never gets called, therefore never invoking a custom toString function, and never propagating an error to the user when toString fails. So in the jsbin, two assertions are recorded. One for not calling toString, and one for not re-throwing a toString exception.

Please provide any additional information below. Attach a screenshot if
possible.

**NOTE:** This is inextricably connected to https://bugs.chromium.org/p/chromium/issues/detail?id=696805
 
Cc: krajshree@chromium.org
Components: Platform>DevTools
Labels: Needs-Feedback
Able to reproduce the issue on Win-10 using chrome reported version #56.0.2924.87 and latest canary #59.0.3040.0.

Attached a screen cast for reference.

Following are the steps followed to reproduce the issue.
------------
1. Opened DevTools on any page
2. Run the code from the following jsbin in the console: https://jsbin.com/kibefuj/edit?js,console
3. Observed that two assertions were recorded i.e 
runner-3.41.6.min.js:1 Assertion failed: The custom label.toString() was never called
runner-3.41.6.min.js:1 Assertion failed: The implementation never re-threw a conversion error to the user

domfarolino@ - Could you please provide the expected behavior screenshot, which will help us in triaging the issue further.

Thanks...!!
700626.mp4
1.2 MB View Download
Hi! Unfortunately no browser passes that test with flying colors so I don't really have a screenshot for you. In other words in every browser that runs the test, at least one failed assertion is seen when an ideal implementation would show 0 failed assertions. At a more granular level, this means:

  1.) When an object is passed in as a label to `console.count(someObjHere)`, an implementation *should* call `someObjHere.toString()` to try and get a string value out of that object. Chrome does not do this.
  2.) Assume (1) passes. If `someObjHere.toString()` (called if (1) passes) throws an error instead of returning an actual string, the error should be re-thrown to the caller. That is what the try{} catch(){} is doing in the test. A correct implementation would always enter the catch block as `someObjHere.toString()` throws an error, however Chrome does not do this. In fact, it never gets a chance to even throw an error, since `toString()` is never called!

Please let me know if this is enough information as to the expected results. In short, no assertions should be seen.
Project Member

Comment 3 by sheriffbot@chromium.org, Mar 14 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Pri-3 M-59 OS-Linux OS-Mac OS-Windows Pri-2
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Mac 10.12.3, Win-10 and Ubuntu 14.04 using chrome reported version #56.0.2924.87 and latest canary #59.0.3041.0.

This is a non-regression issue as it is observed from M50 old builds. 

From M45 and older builds on loading the url: https://jsbin.com/kibefuj/edit?js,console, throws an "
Uncaught SyntaxError: Unexpected identifier" error.

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
Owner: l...@chromium.org
Status: Assigned (was: Untriaged)
Summary: console.count() label toString conversion exhibits odd behavior (was: console.coun() label toString conversion exhibits odd behavior)

Comment 6 by l...@chromium.org, Nov 28 2017

Mergedinto: 696805
Status: Duplicate (was: Assigned)

Sign in to add a comment