[webkit-reviews] review granted: [Bug 199200] Web Inspector: Implement console.countReset : [Attachment 372856] [PATCH] Proposed Fix

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 25 15:11:05 PDT 2019


Devin Rousso <drousso at apple.com> has granted Joseph Pecoraro
<joepeck at webkit.org>'s request for review:
Bug 199200: Web Inspector: Implement console.countReset
https://bugs.webkit.org/show_bug.cgi?id=199200

Attachment 372856: [PATCH] Proposed Fix

https://bugs.webkit.org/attachment.cgi?id=372856&action=review




--- Comment #3 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 372856
  --> https://bugs.webkit.org/attachment.cgi?id=372856
[PATCH] Proposed Fix

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

r=me

> LayoutTests/inspector/console/console-count.html:30
> +    for (let i = 0; i < 10; ++i) {

NIT: since `console.count` starts at 1, perhaps we should have it as `for (let
i = 1; i <= 10; ++i)` so that you can "match" `if (i === 6 || i === 8)` with
the test expectation (where the `6` and `8` are "missing").

> LayoutTests/inspector/console/console-count.html:39
> +    InspectorTest.debug();

Oops :P

> Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp:211
> +void InspectorConsoleAgent::getCounterLabel(Ref<ScriptArguments>&&
arguments, String& title, String& identifier)

Maybe return a `std::pair` or a custom `struct` instead?  I don't like
out-arguments :(

> Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp:226
> +    if
(!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())

NIT: should we put this inside a `LIKELY`?

> Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp:246
> +    if
(!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())

NIT: should we put this inside a `LIKELY`?

> Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp:263
> +    // FIXME: Web Inspector should have a better UI for counters, but for
now we just log an updated counter value.

This isn't technically true, as we don't log anything when we call
`console.countReset` :P

> Source/WebCore/inspector/InspectorInstrumentation.cpp:856
>      if (WebConsoleAgent* consoleAgent =
instrumentingAgents.webConsoleAgent())

Style: `auto*`?

> Source/WebCore/inspector/InspectorInstrumentation.cpp:862
> +    if (WebConsoleAgent* consoleAgent =
instrumentingAgents.webConsoleAgent())

Style: `auto*`?


More information about the webkit-reviews mailing list