mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Split JS::ErrorData out of JS::Error so that it can be used both by JS::Error and WebIDL::DOMException. This adds support for Error.isError to DOMException, also letting us report DOMException stack information to the console.
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Time.h>
|
|
#include <LibIPC/Forward.h>
|
|
#include <LibJS/Console.h>
|
|
#include <LibJS/Forward.h>
|
|
#include <LibWeb/Forward.h>
|
|
#include <LibWebView/ConsoleOutput.h>
|
|
#include <WebContent/Forward.h>
|
|
#include <WebContent/WebContentConsoleClient.h>
|
|
|
|
namespace WebContent {
|
|
|
|
class DevToolsConsoleClient final : public WebContentConsoleClient {
|
|
GC_CELL(DevToolsConsoleClient, WebContentConsoleClient);
|
|
GC_DECLARE_ALLOCATOR(DevToolsConsoleClient);
|
|
|
|
public:
|
|
static GC::Ref<DevToolsConsoleClient> create(JS::Realm&, JS::Console&, PageClient&);
|
|
virtual ~DevToolsConsoleClient() override;
|
|
|
|
private:
|
|
DevToolsConsoleClient(JS::Realm&, JS::Console&, PageClient&, ConsoleGlobalEnvironmentExtensions&);
|
|
|
|
virtual void handle_result(JS::Value) override;
|
|
virtual void report_exception(String const& name, String const& message, JS::ErrorData const&, bool) override;
|
|
virtual void end_group() override { }
|
|
virtual void clear() override { }
|
|
|
|
virtual JS::ThrowCompletionOr<JS::Value> printer(JS::Console::LogLevel, PrinterArguments) override;
|
|
|
|
void send_console_output(WebView::ConsoleOutput);
|
|
};
|
|
|
|
}
|