1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

LibJS: Remove now-unused ThrowableFormat header

The one place this was used now uses the fallible String::formatted.
This commit is contained in:
Timothy Flynn 2023-01-14 10:56:20 -05:00 committed by Linus Groh
parent 9f78e8728a
commit bb4c7b6a35

View file

@ -1,28 +0,0 @@
/*
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/CheckedFormatString.h>
#include <AK/DeprecatedString.h>
#include <AK/Format.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/ErrorTypes.h>
#include <LibJS/Runtime/VM.h>
namespace JS {
template<typename... Args>
ThrowCompletionOr<DeprecatedString> deprecated_format(VM& vm, CheckedFormatString<Args...>&& fmtstr, Args const&... args)
{
StringBuilder builder;
AK::VariadicFormatParams<AK::AllowDebugOnlyFormatters::No, Args...> parameters { args... };
TRY_OR_THROW_OOM(vm, vformat(builder, fmtstr.view(), parameters));
return builder.to_deprecated_string();
}
}