From f40094d0144a37ac20eb13abaf61e11735451053 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 8 Jan 2023 10:42:26 -0700 Subject: LibWeb+LibJS: Format Console arguments with JS::Print Instead of just calling JS::Value::to_string_without_side_effects() when printing values to the console, have all the console clients use the same JS::Print that the REPL does to print values. This method leaves some things to be desired as far as OOM hardening goes, however. We should be able to create a String in a way that doesn't OOM on failure so hard. --- Userland/Libraries/LibJS/Console.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Userland/Libraries/LibJS/Console.h') diff --git a/Userland/Libraries/LibJS/Console.h b/Userland/Libraries/LibJS/Console.h index 34f45a71b5..6394c14e50 100644 --- a/Userland/Libraries/LibJS/Console.h +++ b/Userland/Libraries/LibJS/Console.h @@ -116,6 +116,8 @@ public: virtual void clear() = 0; virtual void end_group() = 0; + ThrowCompletionOr generically_format_values(MarkedVector const&); + protected: virtual ~ConsoleClient() = default; -- cgit v1.2.3