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

LibJS: Make Utf16String & related APIs infallible

Work towards #20449.
This commit is contained in:
Andreas Kling 2023-08-08 18:54:20 +02:00
parent 9708b86d65
commit 7849950383
15 changed files with 82 additions and 88 deletions

View file

@ -388,7 +388,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::parse_int)
// 19.2.6.5 Encode ( string, extraUnescaped ), https://tc39.es/ecma262/#sec-encode
static ThrowCompletionOr<DeprecatedString> encode(VM& vm, DeprecatedString const& string, StringView unescaped_set)
{
auto utf16_string = TRY(Utf16String::create(vm, string));
auto utf16_string = Utf16String::create(string);
// 1. Let strLen be the length of string.
auto string_length = utf16_string.length_in_code_units();