1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

LibJS: Convert remaining usages of Value::TDSWOSE to Value::TSWOSE

Note the couple of cases using MUST are just debugging statements.
This commit is contained in:
Timothy Flynn 2023-02-12 21:54:02 -05:00 committed by Linus Groh
parent c17589a402
commit 24e9cea524
8 changed files with 28 additions and 22 deletions

View file

@ -230,8 +230,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 = name.to_deprecated_string_without_side_effects();
auto message_string = message.to_deprecated_string_without_side_effects();
auto name_string = TRY(name.to_string_without_side_effects());
auto message_string = TRY(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));
@ -1018,7 +1018,7 @@ ErrorOr<void> print_value(JS::PrintContext& print_context, JS::Value value, Hash
TRY(js_out(print_context, "\""));
else if (value.is_negative_zero())
TRY(js_out(print_context, "-"));
TRY(js_out(print_context, "{}", value.to_deprecated_string_without_side_effects()));
TRY(js_out(print_context, "{}", TRY(value.to_string_without_side_effects())));
if (value.is_string())
TRY(js_out(print_context, "\""));
TRY(js_out(print_context, "\033[0m"));