From eabdbe0ee9d025891fc9e0c532bde433b857bbad Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 4 Apr 2020 22:14:03 +0200 Subject: [PATCH] LibJS: Log when we throw a JavaScript Error This makes debugging a lot easier since we actually learn that an Error got thrown. --- Libraries/LibJS/Interpreter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/LibJS/Interpreter.cpp b/Libraries/LibJS/Interpreter.cpp index 241bb673ee..5192713995 100644 --- a/Libraries/LibJS/Interpreter.cpp +++ b/Libraries/LibJS/Interpreter.cpp @@ -206,6 +206,10 @@ Value Interpreter::call(Function* function, Value this_value, const Vectorvalue().is_object() && exception->value().as_object().is_error()) { + auto& error = static_cast(exception->value().as_object()); + dbg() << "Throwing JavaScript Error: " << error.name() << ", " << error.message(); + } m_exception = exception; unwind(ScopeType::Try); return {};