diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-10-20 08:46:31 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-10-20 08:46:31 (GMT) |
commit | e87b66fc81600e43eb1b9696c6e97d6c4ff4ab90 (patch) | |
tree | 7d0c29bcba56d9be5b6623f5e98b5b8e81e1bda2 /src/script/api/qscriptengine.cpp | |
parent | a210a1efb3a255235ab22e618c61d0aaccba3d9f (diff) | |
parent | 1a11cc88e8516097e73d7aefc44c9a97ea0b5aef (diff) | |
download | Qt-e87b66fc81600e43eb1b9696c6e97d6c4ff4ab90.zip Qt-e87b66fc81600e43eb1b9696c6e97d6c4ff4ab90.tar.gz Qt-e87b66fc81600e43eb1b9696c6e97d6c4ff4ab90.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index b1f36be..360036a 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2164,7 +2164,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file if (debugger) debugger->evaluateStart(sourceId); - exec->clearException(); + clearExceptions(); JSC::DynamicGlobalObjectScope dynamicGlobalObjectScope(exec, exec->scopeChain()->globalObject()); JSC::EvalExecutable executable(exec, source); @@ -2381,7 +2381,7 @@ bool QScriptEngine::hasUncaughtException() const { Q_D(const QScriptEngine); JSC::ExecState* exec = d->globalExec(); - return exec->hadException(); + return exec->hadException() || d->currentException().isValid(); } /*! @@ -2398,8 +2398,13 @@ bool QScriptEngine::hasUncaughtException() const QScriptValue QScriptEngine::uncaughtException() const { Q_D(const QScriptEngine); + QScriptValue result; JSC::ExecState* exec = d->globalExec(); - return const_cast<QScriptEnginePrivate*>(d)->scriptValueFromJSCValue(exec->exception()); + if (exec->hadException()) + result = const_cast<QScriptEnginePrivate*>(d)->scriptValueFromJSCValue(exec->exception()); + else + result = d->currentException(); + return result; } /*! @@ -2452,6 +2457,7 @@ void QScriptEngine::clearExceptions() Q_D(QScriptEngine); JSC::ExecState* exec = d->currentFrame; exec->clearException(); + d->clearCurrentException(); } /*! |