mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
LibJS: Remove the now-unused ThrowableStringBuilder
This commit is contained in:
parent
573cbb5ca0
commit
d0fd34112f
4 changed files with 0 additions and 100 deletions
|
@ -256,7 +256,6 @@ shared_library("LibJS") {
|
||||||
"Runtime/Temporal/ZonedDateTime.cpp",
|
"Runtime/Temporal/ZonedDateTime.cpp",
|
||||||
"Runtime/Temporal/ZonedDateTimeConstructor.cpp",
|
"Runtime/Temporal/ZonedDateTimeConstructor.cpp",
|
||||||
"Runtime/Temporal/ZonedDateTimePrototype.cpp",
|
"Runtime/Temporal/ZonedDateTimePrototype.cpp",
|
||||||
"Runtime/ThrowableStringBuilder.cpp",
|
|
||||||
"Runtime/TypedArray.cpp",
|
"Runtime/TypedArray.cpp",
|
||||||
"Runtime/TypedArrayConstructor.cpp",
|
"Runtime/TypedArrayConstructor.cpp",
|
||||||
"Runtime/TypedArrayPrototype.cpp",
|
"Runtime/TypedArrayPrototype.cpp",
|
||||||
|
|
|
@ -238,7 +238,6 @@ set(SOURCES
|
||||||
Runtime/Temporal/ZonedDateTime.cpp
|
Runtime/Temporal/ZonedDateTime.cpp
|
||||||
Runtime/Temporal/ZonedDateTimeConstructor.cpp
|
Runtime/Temporal/ZonedDateTimeConstructor.cpp
|
||||||
Runtime/Temporal/ZonedDateTimePrototype.cpp
|
Runtime/Temporal/ZonedDateTimePrototype.cpp
|
||||||
Runtime/ThrowableStringBuilder.cpp
|
|
||||||
Runtime/TypedArray.cpp
|
Runtime/TypedArray.cpp
|
||||||
Runtime/TypedArrayConstructor.cpp
|
Runtime/TypedArrayConstructor.cpp
|
||||||
Runtime/TypedArrayPrototype.cpp
|
Runtime/TypedArrayPrototype.cpp
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <AK/Utf16View.h>
|
|
||||||
#include <LibJS/Runtime/ThrowableStringBuilder.h>
|
|
||||||
|
|
||||||
namespace JS {
|
|
||||||
|
|
||||||
ThrowableStringBuilder::ThrowableStringBuilder(VM& vm)
|
|
||||||
: m_vm(vm)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ThrowCompletionOr<void> ThrowableStringBuilder::append(char ch)
|
|
||||||
{
|
|
||||||
TRY_OR_THROW_OOM(m_vm, try_append(ch));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
ThrowCompletionOr<void> ThrowableStringBuilder::append(StringView string)
|
|
||||||
{
|
|
||||||
TRY_OR_THROW_OOM(m_vm, try_append(string));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
ThrowCompletionOr<void> ThrowableStringBuilder::append(Utf16View const& string)
|
|
||||||
{
|
|
||||||
TRY_OR_THROW_OOM(m_vm, try_append(string));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
ThrowCompletionOr<void> ThrowableStringBuilder::append_code_point(u32 value)
|
|
||||||
{
|
|
||||||
TRY_OR_THROW_OOM(m_vm, try_append_code_point(value));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
ThrowCompletionOr<String> ThrowableStringBuilder::to_string() const
|
|
||||||
{
|
|
||||||
return TRY_OR_THROW_OOM(m_vm, StringBuilder::to_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <AK/Format.h>
|
|
||||||
#include <AK/StringBuilder.h>
|
|
||||||
#include <AK/StringView.h>
|
|
||||||
#include <LibJS/Forward.h>
|
|
||||||
#include <LibJS/Runtime/Completion.h>
|
|
||||||
#include <LibJS/Runtime/ErrorTypes.h>
|
|
||||||
#include <LibJS/Runtime/VM.h>
|
|
||||||
|
|
||||||
namespace JS {
|
|
||||||
|
|
||||||
class ThrowableStringBuilder : private AK::StringBuilder {
|
|
||||||
public:
|
|
||||||
explicit ThrowableStringBuilder(VM&);
|
|
||||||
|
|
||||||
ThrowCompletionOr<void> append(char);
|
|
||||||
ThrowCompletionOr<void> append(StringView);
|
|
||||||
ThrowCompletionOr<void> append(Utf16View const&);
|
|
||||||
ThrowCompletionOr<void> append_code_point(u32 value);
|
|
||||||
ThrowCompletionOr<String> to_string() const;
|
|
||||||
|
|
||||||
template<typename... Parameters>
|
|
||||||
ThrowCompletionOr<void> appendff(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
|
|
||||||
{
|
|
||||||
AK::VariadicFormatParams<AK::AllowDebugOnlyFormatters::No, Parameters...> variadic_format_params { parameters... };
|
|
||||||
TRY_OR_THROW_OOM(m_vm, vformat(*this, fmtstr.view(), variadic_format_params));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class SeparatorType, class CollectionType>
|
|
||||||
ThrowCompletionOr<void> join(SeparatorType const& separator, CollectionType const& collection, StringView fmtstr = "{}"sv)
|
|
||||||
{
|
|
||||||
TRY_OR_THROW_OOM(m_vm, try_join(separator, collection, fmtstr));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
using AK::StringBuilder::is_empty;
|
|
||||||
using AK::StringBuilder::string_view;
|
|
||||||
using AK::StringBuilder::trim;
|
|
||||||
|
|
||||||
private:
|
|
||||||
VM& m_vm;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue