LibJS: Add source locations to console.trace()

LibJS+DevTools: Implement console.trace() with source locations

- Add Console::TraceFrame struct with source location data
- Implement Console::trace() to gather stack information
- Add WebView::StackFrame and ConsoleTrace for IPC
- Implement DevToolsConsoleClient::printer() for traces
- Update FrameActor to format traces for DevTools
- Update WorkerDebugConsoleClient trace handling
- Update ReplConsoleClient to format trace output
This commit is contained in:
Adam Colvin 2026-01-16 06:26:42 +00:00 committed by Sam Atkins
parent 0b346d1952
commit 2df5a7bb31
Notes: github-actions[bot] 2026-02-06 11:59:15 +00:00
10 changed files with 145 additions and 24 deletions

View file

@ -46,8 +46,8 @@ JS::ThrowCompletionOr<JS::Value> WorkerDebugConsoleClient::printer(JS::Console::
if (!trace.label.is_empty())
builder.appendff("{}\033[36;1m{}\033[0m\n", indent, trace.label);
for (auto& function_name : trace.stack)
builder.appendff("{}-> {}\n", indent, function_name);
for (auto& frame : trace.stack)
builder.appendff("{}-> {}\n", indent, frame.function_name);
dbgln("{}", builder.string_view());
return JS::js_undefined();