From 153b7936381916aef185686d84e255380bb80f1d Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 16 Feb 2023 11:45:07 -0500 Subject: [PATCH] LibJS: Add a throwable StringBuilder::join method --- Userland/Libraries/LibJS/Runtime/ThrowableStringBuilder.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/ThrowableStringBuilder.h b/Userland/Libraries/LibJS/Runtime/ThrowableStringBuilder.h index bbee3e3cbe..452d0ff0b4 100644 --- a/Userland/Libraries/LibJS/Runtime/ThrowableStringBuilder.h +++ b/Userland/Libraries/LibJS/Runtime/ThrowableStringBuilder.h @@ -34,6 +34,13 @@ public: return {}; } + template + ThrowCompletionOr 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;