Web Inspector: Give console.time/timeEnd a default label and warnings
https://bugs.webkit.org/show_bug.cgi?id=157325
<rdar://problem/26073290>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-03
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Provide more user friendly console.time/timeEnd. The timer name
is now optional, and is "default" if not provided. Also provide
warnings when attempting to start an already started timer,
or stop a timer that does not exist.

* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::startTiming):
(Inspector::InspectorConsoleAgent::stopTiming):
Warnings for bad cases.

* runtime/ConsoleObject.cpp:
(JSC::defaultLabelString):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
Optional label becomes "default".

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js:
Update the convenience signature.

LayoutTests:

* inspector/console/console-time-expected.txt: Added.
* inspector/console/console-time.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@200400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
8 files changed