diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-08-18 02:19:24 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-08-18 02:19:24 (GMT) |
commit | 146abce0f1c6b5f019f3e8f6d191fb4c6cf5b9f7 (patch) | |
tree | 6ba2e4d63e0e0e74315168541c8d0d9e93c1845e /src/declarative/qml/qmlexpression.cpp | |
parent | 39a2e72700aa481fefc7df7fa64d8dc8c1670d2e (diff) | |
download | Qt-146abce0f1c6b5f019f3e8f6d191fb4c6cf5b9f7.zip Qt-146abce0f1c6b5f019f3e8f6d191fb4c6cf5b9f7.tar.gz Qt-146abce0f1c6b5f019f3e8f6d191fb4c6cf5b9f7.tar.bz2 |
Slightly change implementation of scope chain.
Preparation for merge of QtScript's JSC backend.
Diffstat (limited to 'src/declarative/qml/qmlexpression.cpp')
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index f8e78d7..00454a1 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -225,13 +225,9 @@ QVariant QmlExpressionPrivate::evalQtScript() ctxtPriv->defaultObjects.insert(ctxtPriv->highPriorityCount, me); QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); - QScriptValueList oldScopeChain = - scriptEngine->currentContext()->scopeChain(); - - for (int i = 0; i < oldScopeChain.size(); ++i) - scriptEngine->currentContext()->popScope(); + QScriptContext *scriptContext = scriptEngine->pushContext(); for (int i = ctxtPriv->scopeChain.size() - 1; i > -1; --i) - scriptEngine->currentContext()->pushScope(ctxtPriv->scopeChain.at(i)); + scriptContext->pushScope(ctxtPriv->scopeChain.at(i)); if (!expressionFunctionValid) { @@ -305,10 +301,7 @@ QVariant QmlExpressionPrivate::evalQtScript() if (rv.isNull()) rv = svalue.toVariant(); - for (int i = 0; i < ctxtPriv->scopeChain.size(); ++i) - scriptEngine->currentContext()->popScope(); - for (int i = oldScopeChain.size() - 1; i > -1; --i) - scriptEngine->currentContext()->pushScope(oldScopeChain.at(i)); + scriptEngine->popContext(); return rv; } |