mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
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.
This commit is contained in:
parent
0ea697ace5
commit
f40094d014
Notes:
sideshowbarker
2024-07-17 17:06:59 +09:00
Author: https://github.com/ADKaster
Commit: f40094d014
Pull-request: https://github.com/SerenityOS/serenity/pull/16914
Reviewed-by: https://github.com/linusg
6 changed files with 25 additions and 4 deletions
|
@ -58,7 +58,7 @@ JS::ThrowCompletionOr<JS::Value> WorkerDebugConsoleClient::printer(JS::Console::
|
|||
return JS::js_undefined();
|
||||
}
|
||||
|
||||
auto output = TRY_OR_THROW_OOM(vm, String::join(' ', arguments.get<JS::MarkedVector<JS::Value>>()));
|
||||
auto output = TRY(generically_format_values(arguments.get<JS::MarkedVector<JS::Value>>()));
|
||||
m_console.output_debug_message(log_level, output);
|
||||
|
||||
switch (log_level) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue