diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2016-10-28 15:20:19 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-10-28 15:20:19 +0200 |
commit | ee726002ae4a50ae9334132f6257803bbed23559 (patch) | |
tree | 57fe366d6ad8285812b435b5e47039c004b32064 /src | |
parent | 9cd8653eef26acdec85c33c350ae47291b99a9b5 (diff) | |
parent | 738ed8e5c0de334d780659bbef8a360154a87221 (diff) |
Merge 1.6 into master
Change-Id: I7ae9ebf1bd9ff2f4062a20dbd50333d055f8f6c3
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/language/evaluatorscriptclass.cpp | 20 | ||||
-rw-r--r-- | src/lib/corelib/language/modulemerger.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/tst_language.cpp | 8 |
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); } |