1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +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

@ -99,7 +99,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::from_char_code)
}
// 3. Return result.
return PrimitiveString::create(vm, TRY(Utf16String::create(vm, move(string))));
return PrimitiveString::create(vm, Utf16String::create(move(string)));
}
// 22.1.2.2 String.fromCodePoint ( ...codePoints ), https://tc39.es/ecma262/#sec-string.fromcodepoint
@ -134,7 +134,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::from_code_point)
VERIFY(string.is_empty());
// 4. Return result.
return PrimitiveString::create(vm, TRY(Utf16String::create(vm, move(string))));
return PrimitiveString::create(vm, Utf16String::create(move(string)));
}
// 22.1.2.4 String.raw ( template, ...substitutions ), https://tc39.es/ecma262/#sec-string.raw