summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-20 14:01:15 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-20 14:01:15 (GMT)
commit393db7ada80e803c73fa65f68f5dd037c16ed836 (patch)
tree0f047d6127e36d23dd0e0d214b2d887038d483c5 /src/script/api/qscriptengine.cpp
parentd4dd08918082372d3df7be2d3a6671cbd7bc7fd3 (diff)
parentcbca69bb0c7e3c42bf7d2d964057f38263de0553 (diff)
downloadQt-393db7ada80e803c73fa65f68f5dd037c16ed836.zip
Qt-393db7ada80e803c73fa65f68f5dd037c16ed836.tar.gz
Qt-393db7ada80e803c73fa65f68f5dd037c16ed836.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-widget-team into 4.6
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp12
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();
}
/*!