mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibJS: Make PrimitiveString::utf8_string() infallible
Work towards #20449.
This commit is contained in:
parent
7849950383
commit
c084269e5f
Notes:
sideshowbarker
2024-07-16 22:11:09 +09:00
Author: https://github.com/awesomekling
Commit: c084269e5f
Pull-request: https://github.com/SerenityOS/serenity/pull/20451
Reviewed-by: https://github.com/trflynn89
29 changed files with 79 additions and 93 deletions
|
@ -59,7 +59,7 @@ ThrowCompletionOr<Value> Console::assert_()
|
|||
// 3. Otherwise:
|
||||
else {
|
||||
// 1. Let concat be the concatenation of message, U+003A (:), U+0020 SPACE, and first.
|
||||
auto concat = TRY_OR_THROW_OOM(vm, String::formatted("{}: {}", TRY(message->utf8_string()), MUST(first.to_string(vm))));
|
||||
auto concat = TRY_OR_THROW_OOM(vm, String::formatted("{}: {}", message->utf8_string(), MUST(first.to_string(vm))));
|
||||
// 2. Set data[0] to concat.
|
||||
data[0] = PrimitiveString::create(vm, move(concat));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue