mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS: Only log exception throw information on Serenity
This is a bit annoying when running the js REPL as part of the Lagom build, as it prints the error twice to the same terminal - once from dbg() and then from printf(). Long term this should probably be removed completely and each program take care itself of printing stacktraces to an appropriate location.
This commit is contained in:
committed by
Andreas Kling
parent
602c3fdb3a
commit
bc307f6b1c
@@ -239,6 +239,7 @@ Value Interpreter::construct(Function& function, Function& new_target, Optional<
|
||||
|
||||
Value Interpreter::throw_exception(Exception* exception)
|
||||
{
|
||||
#ifdef __serenity__
|
||||
if (exception->value().is_object() && exception->value().as_object().is_error()) {
|
||||
auto& error = static_cast<Error&>(exception->value().as_object());
|
||||
dbg() << "Throwing JavaScript Error: " << error.name() << ", " << error.message();
|
||||
@@ -250,6 +251,7 @@ Value Interpreter::throw_exception(Exception* exception)
|
||||
dbg() << " " << function_name;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
m_exception = exception;
|
||||
unwind(ScopeType::Try);
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user