Bug 157325

Summary: Web Inspector: Give console.time/timeEnd a default label and warnings
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, keith_miller, mark.lam, mattbaker, mkwst, msaboff, nvasilyev, saam, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
timothy: review+
[IMAGE] Example use and warnings
none
[IMAGE] API Description Update
none
[PATCH] For Landing none

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>