diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-03-03 04:36:17 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-03-03 04:48:46 (GMT) |
commit | a2c2a287e6c405200ef990f3dddae9d229aac722 (patch) | |
tree | 3b8c93173267e93ded50d793dab72112c3515573 /src/declarative/qml/qdeclarativecontext.cpp | |
parent | 6e486bdd5cc8370df7752eda2fa9f75b0a962124 (diff) | |
download | Qt-a2c2a287e6c405200ef990f3dddae9d229aac722.zip Qt-a2c2a287e6c405200ef990f3dddae9d229aac722.tar.gz Qt-a2c2a287e6c405200ef990f3dddae9d229aac722.tar.bz2 |
Fix incorrect scope resolution for script in a script block.
Make sure global variables in a script file are searched before
component properties.
Task-number: QTBUG-8641
Diffstat (limited to 'src/declarative/qml/qdeclarativecontext.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativecontext.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index b244cd8..57ef90c 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -78,6 +78,7 @@ void QDeclarativeContextPrivate::addScript(const QDeclarativeParser::Object::Scr QScriptValue scope = scriptEngine->newObject(); scriptContext->setActivationObject(scope); + scriptContext->pushScope(scope); for (int ii = 0; ii < script.codes.count(); ++ii) { scriptEngine->evaluate(script.codes.at(ii), script.files.at(ii), script.lineNumbers.at(ii)); |