summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-07-23 14:06:08 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-07-23 14:54:35 (GMT)
commit9d2760f619782145e0861300901531a56c12991a (patch)
treef6f1bc0590571c3798a4b12412ba4979db47d427 /src/script
parent558fafd76690e067b775a28a739c6aedfdffe783 (diff)
downloadQt-9d2760f619782145e0861300901531a56c12991a.zip
Qt-9d2760f619782145e0861300901531a56c12991a.tar.gz
Qt-9d2760f619782145e0861300901531a56c12991a.tar.bz2
QScriptEngineAgent: ensure that the top of the backtrace is correct in exceptionThrow
Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengineagent.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index 28905e8..0b5828a 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -134,9 +134,12 @@ void QScriptEngineAgentPrivate::returnEvent(const JSC::DebuggerCallFrame& frame,
void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler)
{
JSC::CallFrame *oldFrame = engine->currentFrame;
+ int oldAgentLineNumber = engine->agentLineNumber;
engine->currentFrame = frame.callFrame();
QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
+ engine->agentLineNumber = value.property(QLatin1String("lineNumber")).toInt32();
q_ptr->exceptionThrow(sourceID, value, hasHandler);
+ engine->agentLineNumber = oldAgentLineNumber;
engine->currentFrame = oldFrame;
engine->setCurrentException(value);
};