1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:37:46 +00:00

LibUnicode+LibJS: Propagate OOM from Unicode normalization

This commit is contained in:
Timothy Flynn 2023-01-08 11:05:51 -05:00 committed by Linus Groh
parent 1ff29afc45
commit 3d22efccca
4 changed files with 74 additions and 82 deletions

View file

@ -499,7 +499,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 = Unicode::normalize(string, unicode_form);
auto ns = TRY_OR_THROW_OOM(vm, Unicode::normalize(string, unicode_form));
// 7. return ns.
return PrimitiveString::create(vm, move(ns));