aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-02 20:15:47 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-03 14:38:23 +0100
commitc46c35e8e5486fb98b287eeed7c4f58d0840d267 (patch)
treed7086583a5d5ccfcda9afe8d1f5ba318b5277e4a /src/qml/qml/qqmlobjectcreator.cpp
parentd1c6561ec7a515bc78061e4070a03bf999d384b6 (diff)
[new compiler] Fix context sharing for imported JS files that have no import themselves
They should share the imports from the importing context, which means context->importedScripts needs to be initialized before calling scriptValueForContext, because it accesses it. Change-Id: Ifed22555028e03d597954ba1a18e546bfb901c58 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 1b3235b9b6..ea4270b848 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -145,11 +145,11 @@ QObject *QmlObjectCreator::create(int subComponentIndex, QObject *parent)
QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine);
QV4::Scope scope(v4);
QV4::ScopedObject scripts(scope, v4->newArrayObject(compiledData->scripts.count()));
+ context->importedScripts = scripts;
for (int i = 0; i < compiledData->scripts.count(); ++i) {
QQmlScriptData *s = compiledData->scripts.at(i);
scripts->putIndexed(i, s->scriptValueForContext(context));
}
- context->importedScripts = scripts;
} else if (parentContext) {
context->importedScripts = parentContext->importedScripts;
}