diff options
-rw-r--r-- | Libraries/LibJS/Interpreter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibJS/Interpreter.cpp b/Libraries/LibJS/Interpreter.cpp index 06362bc173..48820e9f10 100644 --- a/Libraries/LibJS/Interpreter.cpp +++ b/Libraries/LibJS/Interpreter.cpp @@ -219,6 +219,13 @@ Value Interpreter::throw_exception(Exception* exception) 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(); + + for (ssize_t i = m_call_stack.size() - 1; i >= 0; --i) { + auto function_name = m_call_stack[i].function_name; + if (function_name.is_empty()) + function_name = "<anonymous>"; + dbg() << " " << function_name; + } } m_exception = exception; unwind(ScopeType::Try); |