1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 07:32:14 +00:00

LibJS+LibWeb+WebContent: Stop using ThrowableStringBuilder

This commit is contained in:
Timothy Flynn 2023-09-06 08:29:01 -04:00 committed by Tim Flynn
parent 54d1f4e234
commit 573cbb5ca0
6 changed files with 43 additions and 46 deletions

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/StringBuilder.h>
#include <LibJS/Heap/MarkedVector.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/Realm.h>
#include <LibJS/Runtime/ThrowableStringBuilder.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/HTML/WorkerDebugConsoleClient.h>
@ -40,12 +40,12 @@ JS::ThrowCompletionOr<JS::Value> WorkerDebugConsoleClient::printer(JS::Console::
if (log_level == JS::Console::LogLevel::Trace) {
auto trace = arguments.get<JS::Console::Trace>();
JS::ThrowableStringBuilder builder(vm);
StringBuilder builder;
if (!trace.label.is_empty())
MUST_OR_THROW_OOM(builder.appendff("{}\033[36;1m{}\033[0m\n", indent, trace.label));
builder.appendff("{}\033[36;1m{}\033[0m\n", indent, trace.label);
for (auto& function_name : trace.stack)
MUST_OR_THROW_OOM(builder.appendff("{}-> {}\n", indent, function_name));
builder.appendff("{}-> {}\n", indent, function_name);
dbgln("{}", builder.string_view());
return JS::js_undefined();