You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 432718f
Browse filesBrowse the repository at this point in the historyBrowse files
Web Inspector: toString is called twice by console log
https://bugs.webkit.org/show_bug.cgi?id=306712
Reviewed by Timothy Hatcher.
Web Inspector attempts to stringify the first argument passed to `console` methods as the primary "message".
If the first argument is an object, however, this happens again when generating a `description` for the `Runtime.RemoteObject`.
This second can be used to observe whether Web Inspector is open as the latter only happens then.
To avoid this, we can simply save and reuse the result of the first instead of doing it again.
* Source/JavaScriptCore/inspector/ConsoleMessage.h:
(Inspector::ConsoleMessage::setMessageIsFirstArgument): Added.
* Source/JavaScriptCore/inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::addToFrontend):
* Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::messageWithTypeAndLevel):
* Source/WebCore/page/FrameConsoleClient.cpp:
(WebCore::FrameConsoleClient::messageWithTypeAndLevel):
* Source/WebCore/workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
* Source/JavaScriptCore/inspector/InjectedScript.h:
* Source/JavaScriptCore/inspector/InjectedScript.cpp:
(Inspector::InjectedScript::wrapObject const):
* Source/JavaScriptCore/inspector/InjectedScriptSource.js:
(InjectedScript.prototype.wrapObject):
(RemoteObject):
(RemoteObject.create):
(RemoteObject.describe):
* LayoutTests/inspector/console/console-log-single-tostring-invocation.html: Added.
* LayoutTests/inspector/console/console-log-single-tostring-invocation-expected.txt: Added.
* LayoutTests/inspector/worker/console-basic.html:
* LayoutTests/inspector/worker/console-basic-expected.txt:
Canonical link: https://commits.webkit.org/323668@main
0 commit comments