aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-08-26 14:53:58 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2016-10-24 14:57:46 +0000
commit465260e5eaaa3108f6cc0ae70191dd8f403906d4 (patch)
tree16cc1b683201cf83c43b91eea8b94b6a2e210074
parent8720b97e595d5652d00ceea11a3af6d31fd7ba6b (diff)
Add module instance as scope to cloned module prototype
... when evaluating the "prototype part" of list properties. This is necessary so that other properties appearing on the right-hand-side of the property use the value from the instance instead of the one from the prototype. Task-number: QBS-845 Task-number: QBS-966 Change-Id: I7b6c7d068e45f4805422c887239ec81b5c661880 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--share/qbs/modules/cpp/gcc.js10
-rw-r--r--src/lib/corelib/language/evaluatorscriptclass.cpp4
-rw-r--r--src/lib/corelib/language/modulemerger.cpp2
-rw-r--r--src/lib/corelib/language/tst_language.cpp1
4 files changed, 3 insertions, 14 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 641d8e579..23b3eaf37 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -112,16 +112,6 @@ function linkerFlags(project, product, inputs, output) {
var isDarwin = product.moduleProperty("qbs", "targetOS").contains("darwin");
var i, args = additionalCompilerAndLinkerFlags(product);
- // ### QBS-966
- if (product.moduleProperty("qbs", "targetOS").contains("android")) {
- var sharedStlFilePath = product.moduleProperty("cpp", "sharedStlFilePath");
- if (sharedStlFilePath)
- dynamicLibraries.push(sharedStlFilePath);
- var staticStlFilePath = product.moduleProperty("cpp", "staticStlFilePath");
- if (staticStlFilePath)
- staticLibraries.push(staticStlFilePath);
- }
-
if (output.fileTags.contains("dynamiclibrary")) {
args.push(isDarwin ? "-dynamiclib" : "-shared");
diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp
index aa07935dc..90bc8c49a 100644
--- a/src/lib/corelib/language/evaluatorscriptclass.cpp
+++ b/src/lib/corelib/language/evaluatorscriptclass.cpp
@@ -243,12 +243,12 @@ private:
pushScope(data->evaluator->fileScope(value->file()));
pushItemScopes(data->item);
- if (value->definingItem())
- pushItemScopes(value->definingItem());
if (itemOfProperty && itemOfProperty->type() != ItemType::ModuleInstance) {
// Own properties of module instances must not have the instance itself in the scope.
pushScope(*object);
}
+ if (value->definingItem())
+ pushItemScopes(value->definingItem());
if (value->exportScope())
pushScope(data->evaluator->scriptValue(value->exportScope()));
pushScope(extraScope);
diff --git a/src/lib/corelib/language/modulemerger.cpp b/src/lib/corelib/language/modulemerger.cpp
index b468e0970..4fa822686 100644
--- a/src/lib/corelib/language/modulemerger.cpp
+++ b/src/lib/corelib/language/modulemerger.cpp
@@ -245,7 +245,7 @@ void ModuleMerger::appendPrototypeValueToNextChain(Item *moduleProto, const QStr
return;
if (!m_clonedModulePrototype) {
m_clonedModulePrototype = moduleProto->clone();
- m_clonedModulePrototype->setScope(m_mergedModule.item->scope());
+ m_clonedModulePrototype->setScope(m_mergedModule.item);
}
const ValuePtr clonedValue = m_clonedModulePrototype->property(propertyName);
QBS_CHECK(clonedValue);
diff --git a/src/lib/corelib/language/tst_language.cpp b/src/lib/corelib/language/tst_language.cpp
index 4dec7dbde..166a3f48f 100644
--- a/src/lib/corelib/language/tst_language.cpp
+++ b/src/lib/corelib/language/tst_language.cpp
@@ -1106,7 +1106,6 @@ void TestLanguage::moduleProperties()
QStringList valueStrings;
foreach (const QVariant &v, values)
valueStrings += v.toString();
- QEXPECT_FAIL("list_property_depending_on_overridden_property", "QBS-845", Continue);
QCOMPARE(valueStrings, expectedValues);
}