push/pop a context when loading

svn path=/trunk/KDE/kdelibs/; revision=1159708
This commit is contained in:
Aaron J. Seigo 2010-08-06 01:26:28 +00:00
parent 36c90e7137
commit ae26e2a87c

View File

@ -196,9 +196,11 @@ bool loadScript(const QString &path, const QString &prefix)
QString tmp(buffer.readAll());
QScriptEngine *engine = AnimationScriptEngine::globalEngine();
engine->pushContext();
s_prefix = prefix;
QScriptValue def(engine->evaluate(tmp, path));
s_prefix.clear();
engine->popContext();
if (engine->hasUncaughtException()) {
const QScriptValue error = engine->uncaughtException();
QString file = error.property("fileName").toString();