summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-01-21 22:27:42 -0500
committerTim Flynn <trflynn89@pm.me>2023-01-24 16:23:50 -0500
commit879a590882de7e5b0a8b05b713663728d0966e56 (patch)
tree883ba08ab3e9a9e773a3053096147189bcd08fd9 /Userland/Libraries/LibJS/Runtime
parentd2ec31cbdb198e5b9a7319b639a715ceeadc0b26 (diff)
downloadserenity-879a590882de7e5b0a8b05b713663728d0966e56.zip
LibJS: Propagate OOM errors from ApplyUnicodeExtensionToTag
These were missed in bff0e25ebed03db133c708a05c4f08bb5244d0ba.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp
index e6b002a512..f928208b78 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp
@@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include <AK/DeprecatedString.h>
#include <AK/Optional.h>
#include <AK/String.h>
#include <AK/TypeCasts.h>
@@ -110,7 +109,7 @@ static ThrowCompletionOr<LocaleAndKeys> apply_unicode_extension_to_tag(VM& vm, S
{
// 1. Assert: Type(tag) is String.
// 2. Assert: tag matches the unicode_locale_id production.
- auto locale_id = ::Locale::parse_unicode_locale_id(tag).release_value_but_fixme_should_propagate_errors();
+ auto locale_id = TRY_OR_THROW_OOM(vm, ::Locale::parse_unicode_locale_id(tag));
VERIFY(locale_id.has_value());
Vector<String> attributes;
@@ -189,7 +188,7 @@ static ThrowCompletionOr<LocaleAndKeys> apply_unicode_extension_to_tag(VM& vm, S
// iv. Else,
else {
// 1. Append the Record { [[Key]]: key, [[Value]]: value } to keywords.
- keywords.append({ String::from_utf8(key).release_value_but_fixme_should_propagate_errors(), *value });
+ keywords.append({ TRY_OR_THROW_OOM(vm, String::from_utf8(key)), *value });
}
}