diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-06 05:31:56 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-06 05:31:56 (GMT) |
commit | 067b419199b369b6c81fa1ae387257aa87cab20c (patch) | |
tree | 20ef3dc7c3def67fd74117f50fdae3be054ee836 /src/declarative/util/qmlscript.cpp | |
parent | 9e4b877430a6811079d209656587ea228334ed34 (diff) | |
download | Qt-067b419199b369b6c81fa1ae387257aa87cab20c.zip Qt-067b419199b369b6c81fa1ae387257aa87cab20c.tar.gz Qt-067b419199b369b6c81fa1ae387257aa87cab20c.tar.bz2 |
Improve scope handling
Diffstat (limited to 'src/declarative/util/qmlscript.cpp')
-rw-r--r-- | src/declarative/util/qmlscript.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index 2031a54..5d58f64 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -178,10 +178,8 @@ void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &s QmlContext *context = qmlContext(q); QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); - QScriptContext *scriptContext = scriptEngine->pushContext(); - for (int i = context->d_func()->scopeChain.size() - 1; i >= 0; --i) { - scriptContext->pushScope(context->d_func()->scopeChain.at(i)); - } + QScriptContext *scriptContext = scriptEngine->pushCleanContext(); + scriptContext->pushScope(QmlContextPrivate::get(context)->scriptValue); QScriptValue scope = scriptEngine->newObject(); scriptContext->pushScope(scope); |