summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-22 04:53:20 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-22 04:53:20 (GMT)
commit55b7112a423dbade0e9ebbe54427dab7587a5786 (patch)
tree7e99c0dd3c5099cec06409ed7a06e2d8addfe429 /src/script/api/qscriptengine.cpp
parentb7ba4ccf9017281c48b47be5988f2fb46dee2c1f (diff)
parentaf92d15b625d2042814323fcebfa41c5bbb6b09d (diff)
downloadQt-55b7112a423dbade0e9ebbe54427dab7587a5786.zip
Qt-55b7112a423dbade0e9ebbe54427dab7587a5786.tar.gz
Qt-55b7112a423dbade0e9ebbe54427dab7587a5786.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
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();
}
/*!