summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-10-19 22:33:29 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-10-19 22:33:29 (GMT)
commitae1cb61204530099f438656226a4b24449658203 (patch)
tree485a961f295ab0db5b60cdd62f6072ac2368dfe6 /src/script/api/qscriptengine.cpp
parent55bddd50925da27f7a106041db44c15057aac6c1 (diff)
parent02c15e6a8cdb0f8a0bb6ee36880877fe90334d69 (diff)
downloadQt-ae1cb61204530099f438656226a4b24449658203.zip
Qt-ae1cb61204530099f438656226a4b24449658203.tar.gz
Qt-ae1cb61204530099f438656226a4b24449658203.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts: tools/qdoc3/cppcodemarker.cpp
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 029d3a5..880fcd7 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2297,7 +2297,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);
@@ -2551,7 +2551,7 @@ bool QScriptEngine::hasUncaughtException() const
{
Q_D(const QScriptEngine);
JSC::ExecState* exec = d->globalExec();
- return exec->hadException();
+ return exec->hadException() || d->currentException().isValid();
}
/*!
@@ -2568,8 +2568,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;
}
/*!
@@ -2622,6 +2627,7 @@ void QScriptEngine::clearExceptions()
Q_D(QScriptEngine);
JSC::ExecState* exec = d->currentFrame;
exec->clearException();
+ d->clearCurrentException();
}
/*!