summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Utf16String.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Utf16String.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Utf16String.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Utf16String.cpp b/Userland/Libraries/LibJS/Runtime/Utf16String.cpp
index e6a4b4caf2..098d761e67 100644
--- a/Userland/Libraries/LibJS/Runtime/Utf16String.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Utf16String.cpp
@@ -6,6 +6,7 @@
#include <AK/StringView.h>
#include <LibJS/Runtime/Utf16String.h>
+#include <LibJS/Runtime/VM.h>
namespace JS {
namespace Detail {
@@ -96,9 +97,9 @@ Utf16View Utf16String::substring_view(size_t code_unit_offset) const
return view().substring_view(code_unit_offset);
}
-DeprecatedString Utf16String::to_utf8() const
+ThrowCompletionOr<DeprecatedString> Utf16String::to_utf8(VM& vm) const
{
- return view().to_utf8(Utf16View::AllowInvalidCodeUnits::Yes);
+ return TRY_OR_THROW_OOM(vm, view().to_utf8(Utf16View::AllowInvalidCodeUnits::Yes));
}
u16 Utf16String::code_unit_at(size_t index) const