Bug 157325 - Web Inspector: Give console.time/timeEnd a default label and warnings
Summary: Web Inspector: Give console.time/timeEnd a default label and warnings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-05-03 14:08 PDT by Joseph Pecoraro
Modified: 2016-05-03 18:37 PDT (History)
13 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (15.50 KB, patch)
2016-05-03 14:42 PDT, Joseph Pecoraro
timothy: review+
Details | Formatted Diff | Diff
[IMAGE] Example use and warnings (97.89 KB, image/png)
2016-05-03 14:43 PDT, Joseph Pecoraro
no flags Details
[IMAGE] API Description Update (141.24 KB, image/png)
2016-05-03 14:44 PDT, Joseph Pecoraro
no flags Details
[PATCH] For Landing (15.53 KB, patch)
2016-05-03 14:48 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-05-03 14:08:32 PDT
* SUMMARY
Give console.time/timeEnd a default label and warnings.

Discussion: <https://github.com/whatwg/console/issues/54>

> void time(optional DOMString label = "default")
> void timeEnd(optional DOMString label = "default")

This mostly matches Edge's behavior and is more user friendly. You should be able to use time/timeEnd without an argument and get a default timer.

When attempting to start an already started timer, or stop a timer that does not exist, we should provide warnings.
Comment 1 Radar WebKit Bug Importer 2016-05-03 14:10:08 PDT
<rdar://problem/26073290>
Comment 2 Joseph Pecoraro 2016-05-03 14:42:10 PDT
Created attachment 278027 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2016-05-03 14:43:23 PDT
Created attachment 278028 [details]
[IMAGE] Example use and warnings
Comment 4 Joseph Pecoraro 2016-05-03 14:44:09 PDT
Created attachment 278029 [details]
[IMAGE] API Description Update
Comment 5 Timothy Hatcher 2016-05-03 14:44:53 PDT
Comment on attachment 278027 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=278027&action=review

> Source/JavaScriptCore/runtime/ConsoleObject.cpp:286
> +static String defaultLabelString(ExecState* exec, JSValue value)

This name implies it always returns the "default" string. valueOrDefaultLabelString?
Comment 6 Joseph Pecoraro 2016-05-03 14:48:44 PDT
Created attachment 278030 [details]
[PATCH] For Landing
Comment 7 WebKit Commit Bot 2016-05-03 18:08:13 PDT
Comment on attachment 278030 [details]
[PATCH] For Landing

Clearing flags on attachment: 278030

Committed r200400: <http://trac.webkit.org/changeset/200400>