From e86eafe65eaec4212f640d6a1ef6ee42cfb4ae1e Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 2 Feb 2023 19:23:04 -0500 Subject: LibJS: Replace remaining uses of StringBuilder in the Intl namespace --- Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp') diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index f7cfc73856..12bf0406a3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -15,6 +15,7 @@ #include #include #include +#include namespace JS::Intl { @@ -507,16 +508,16 @@ ThrowCompletionOr> partition_duration_format_pattern(VM auto parts = MUST_OR_THROW_OOM(partition_number_pattern(vm, *number_format, MathematicalValue(value))); // 6. Let concat be an empty String. - StringBuilder concat; + ThrowableStringBuilder concat(vm); // 7. For each Record { [[Type]], [[Value]], [[Unit]] } part in parts, do for (auto const& part : parts) { // a. Set concat to the string-concatenation of concat and part.[[Value]]. - concat.append(part.value); + TRY(concat.append(part.value)); } // 8. Append the new Record { [[Type]]: unit, [[Value]]: concat } to the end of result. - result.append({ unit, TRY_OR_THROW_OOM(vm, concat.to_string()) }); + result.append({ unit, MUST_OR_THROW_OOM(concat.to_string()) }); } } } -- cgit v1.2.3