mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
LibJS: Make Value::to_string_without_side_effects() infallible
Work towards #20449.
This commit is contained in:
parent
b8f78c0adc
commit
97ebfd9f0f
69 changed files with 182 additions and 182 deletions
|
@ -274,8 +274,8 @@ ErrorOr<void> print_error(JS::PrintContext& print_context, JS::Object const& obj
|
|||
if (name.is_accessor() || message.is_accessor()) {
|
||||
TRY(print_value(print_context, &object, seen_objects));
|
||||
} else {
|
||||
auto name_string = TRY(name.to_string_without_side_effects());
|
||||
auto message_string = TRY(message.to_string_without_side_effects());
|
||||
auto name_string = name.to_string_without_side_effects();
|
||||
auto message_string = message.to_string_without_side_effects();
|
||||
TRY(print_type(print_context, name_string));
|
||||
if (!message_string.is_empty())
|
||||
TRY(js_out(print_context, " \033[31;1m{}\033[0m", message_string));
|
||||
|
@ -1069,7 +1069,7 @@ ErrorOr<void> print_value(JS::PrintContext& print_context, JS::Value value, Hash
|
|||
else if (value.is_negative_zero())
|
||||
TRY(js_out(print_context, "-"));
|
||||
|
||||
auto contents = TRY(value.to_string_without_side_effects());
|
||||
auto contents = value.to_string_without_side_effects();
|
||||
if (value.is_string())
|
||||
TRY(js_out(print_context, "{}", TRY(escape_for_string_literal(contents))));
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue