mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 21:45:29 +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:
committed by
Linus Groh
parent
0ea697ace5
commit
f40094d014
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user