summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-08-15 11:46:23 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-15 13:34:35 +0200
commitdf0ec196031d33850324dc5eeed2d71f61413885 (patch)
tree9e98812061839c550f2d3b4e86f57a47e6bf2b37 /src/3rdparty
parent8854338fe988a38514e69fe52a831a1ac3c6f936 (diff)
downloadqtscript-df0ec196031d33850324dc5eeed2d71f61413885.tar.gz
Make QScriptEngine::uncaughtExceptionBacktrace() work again
This function has been broken since Qt 4.6 (when the JavaScriptCore- based back-end was introduced). Fix it by introducing a callback in JSC that allows us to capture the stack when an uncaught exception occurs. Task-number: QTBUG-6139 Change-Id: I4a829323c9fb0c8b2f16a2e5d6f0aeb13cc32561 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
index 2164b1d..9269fdd 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
@@ -584,6 +584,8 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV
}
if (debugger)
debugger->exceptionThrow(DebuggerCallFrame(callFrame, exceptionValue), codeBlock->ownerExecutable()->sourceID(), hasHandler);
+ else if (!hasHandler)
+ callFrame->globalData().clientData->uncaughtException(callFrame, bytecodeOffset, exceptionValue);
#endif
while (!(handler = codeBlock->handlerForBytecodeOffset(bytecodeOffset))) {
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h
index dcd3289..e38a2bc 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h
@@ -89,6 +89,7 @@ namespace JSC {
virtual ~ClientData() = 0;
#ifdef QT_BUILD_SCRIPT_LIB
virtual void mark(MarkStack&) {}
+ virtual void uncaughtException(ExecState*, unsigned bytecodeOffset, JSValue) = 0;
#endif
};