1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:57:35 +00:00

LibUnicode+LibJS: Stop propagating small OOM errors from normalization

This API only perform small allocations, and is only used by LibJS.
This commit is contained in:
Timothy Flynn 2023-09-06 07:25:56 -04:00 committed by Tim Flynn
parent 331991f9c4
commit 02a8683266
4 changed files with 65 additions and 69 deletions

View file

@ -666,7 +666,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::normalize)
// 6. Let ns be the String value that is the result of normalizing S into the normalization form named by f as specified in https://unicode.org/reports/tr15/.
auto unicode_form = Unicode::normalization_form_from_string(form);
auto ns = TRY_OR_THROW_OOM(vm, Unicode::normalize(string, unicode_form));
auto ns = Unicode::normalize(string, unicode_form);
// 7. Return ns.
return PrimitiveString::create(vm, move(ns));