diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-08-15 11:46:23 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-15 13:34:35 +0200 |
commit | df0ec196031d33850324dc5eeed2d71f61413885 (patch) | |
tree | 9e98812061839c550f2d3b4e86f57a47e6bf2b37 /src/script/api/qscriptcontextinfo.cpp | |
parent | 8854338fe988a38514e69fe52a831a1ac3c6f936 (diff) | |
download | qtscript-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/script/api/qscriptcontextinfo.cpp')
-rw-r--r-- | src/script/api/qscriptcontextinfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index 0e7884f..0fe035d 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -145,6 +145,8 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte frame = rewindContext; //for retreiving the global context's "fake" frame // An agent might have provided the line number. lineNumber = QScript::scriptEngineFromExec(frame)->agentLineNumber; + if (lineNumber == -1) + lineNumber = QScript::scriptEngineFromExec(frame)->uncaughtExceptionLineNumber; } else { // rewind the stack from the top in order to find the frame from the caller where the returnPC is stored while (rewindContext && QScriptEnginePrivate::contextForFrame(rewindContext->callerFrame()->removeHostCallFrameFlag()) != context) |