diff options
author | Andrew Kaster <akaster@serenityos.org> | 2023-01-08 10:42:26 -0700 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-21 10:57:44 +0100 |
commit | f40094d0144a37ac20eb13abaf61e11735451053 (patch) | |
tree | 8365ac90da246839ab2c1f44b6cad7331093a35b /Userland/Libraries/LibJS/Console.h | |
parent | 0ea697ace57fbc1de834402077d6f0bde1b82f43 (diff) | |
download | serenity-f40094d0144a37ac20eb13abaf61e11735451053.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Console.h')
-rw-r--r-- | Userland/Libraries/LibJS/Console.h | 2 |
1 files changed, 2 insertions, 0 deletions
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<String> generically_format_values(MarkedVector<Value> const&); + protected: virtual ~ConsoleClient() = default; |