aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-10-28 14:15:54 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-10-28 14:15:54 +0000
commitae1609b0c9f208a0b8d87a9e3c36399f70b30cbc (patch)
treef847658f390580df5186cefb746cabe799ebce6f /src
parent7f73d219d3b38c91bb666450a94d8e98b8aecc53 (diff)
parentee726002ae4a50ae9334132f6257803bbed23559 (diff)
Merge "Merge 1.6 into master"
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/language/evaluatorscriptclass.cpp20
-rw-r--r--src/lib/corelib/language/modulemerger.cpp2
-rw-r--r--src/lib/corelib/language/tst_language.cpp8
3 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp
index b14cbc0db..d7f51f4bf 100644
--- a/src/lib/corelib/language/evaluatorscriptclass.cpp
+++ b/src/lib/corelib/language/evaluatorscriptclass.cpp
@@ -241,24 +241,28 @@ private:
setupConvenienceProperty(QLatin1String("outer"), &extraScope, v);
}
if (value->sourceUsesOriginal()) {
- const Item *item = itemOfProperty;
- while (item->type() == ItemType::ModuleInstance)
- item = item->prototype();
QScriptValue originalValue;
- SVConverter converter(scriptClass, object, item->property(*propertyName), item,
- propertyName, data, &originalValue, sourceValueStack);
- converter.start();
+ if (data->item->propertyDeclaration(propertyName->toString()).isScalar()) {
+ const Item *item = itemOfProperty;
+ while (item->type() == ItemType::ModuleInstance)
+ item = item->prototype();
+ SVConverter converter(scriptClass, object, item->property(*propertyName), item,
+ propertyName, data, &originalValue, sourceValueStack);
+ converter.start();
+ } else {
+ originalValue = engine->newArray(0);
+ }
setupConvenienceProperty(QLatin1String("original"), &extraScope, originalValue);
}
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 fa082ac16..b5aeb995f 100644
--- a/src/lib/corelib/language/modulemerger.cpp
+++ b/src/lib/corelib/language/modulemerger.cpp
@@ -254,7 +254,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 ccea88737..df5bc1d64 100644
--- a/src/lib/corelib/language/tst_language.cpp
+++ b/src/lib/corelib/language/tst_language.cpp
@@ -422,7 +422,6 @@ void TestLanguage::defaultValue()
propertyName = QStringList() << "modules" << "lower" << "listProp";
propertyValue = getConfigProperty(product->moduleProperties->value(), propertyName);
QFETCH(QVariant, expectedListPropValue);
- QEXPECT_FAIL("controlling property not overwritten", "QBS-845", Continue);
QCOMPARE(propertyValue.toStringList(), expectedListPropValue.toStringList());
}
catch (const ErrorInfo &e) {
@@ -438,13 +437,13 @@ void TestLanguage::defaultValue_data()
QTest::addColumn<QVariant>("expectedProp2Value");
QTest::addColumn<QVariant>("expectedListPropValue");
QTest::newRow("controlling property with random value") << "random" << QVariant("withoutBlubb")
- << QVariant(QStringList({"other", "other"}));
+ << QVariant(QStringList({"other"}));
QTest::newRow("controlling property with blubb value") << "blubb" << QVariant("withBlubb")
- << QVariant(QStringList({"blubb", "other", "blubb", "other"}));
+ << QVariant(QStringList({"blubb", "other"}));
QTest::newRow("controlling property with egon value") << "egon" << QVariant("withEgon")
<< QVariant(QStringList({"egon", "other"}));
QTest::newRow("controlling property not overwritten") << "" << QVariant("withBlubb")
- << QVariant(QStringList({"blubb", "other", "blubb", "other"}));
+ << QVariant(QStringList({"blubb", "other"}));
}
void TestLanguage::environmentVariable()
@@ -1115,7 +1114,6 @@ void TestLanguage::moduleProperties()
QStringList valueStrings;
foreach (const QVariant &v, values.toList())
valueStrings += v.toString();
- QEXPECT_FAIL("list_property_depending_on_overridden_property", "QBS-845", Continue);
QCOMPARE(valueStrings, expectedValues);
}