aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-06-25 14:47:13 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-06-25 13:21:46 +0000
commit68911d57b06eede061ad173df43322998c4a8d45 (patch)
tree4f33789bed07c96f7bf132949fde882e83a837a6
parent4aa4811ed0a522e68bf326e37f3812b7156901e9 (diff)
Fix module property access tracking
Track all accesses, regardless whether the value comes from the cache or not. Accesses are tracked per transformer, but the cache is per product/ group. Change-Id: Ia0c856268fe6a3f199103a89604cd3909e6a4308 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/jsextensions/moduleproperties.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/corelib/jsextensions/moduleproperties.cpp b/src/lib/corelib/jsextensions/moduleproperties.cpp
index 7d0a3e0b6..d80a4bc5f 100644
--- a/src/lib/corelib/jsextensions/moduleproperties.cpp
+++ b/src/lib/corelib/jsextensions/moduleproperties.cpp
@@ -82,12 +82,6 @@ static QScriptValue getModuleProperty(const ResolvedProduct *product, const Arti
value = engine->retrieveFromPropertyCache(moduleName, propertyName, properties);
if (!value.isValid()) {
value = properties->moduleProperty(moduleName, propertyName, isPresent);
- const Property p(product->uniqueName(), moduleName, propertyName, value,
- Property::PropertyInModule);
- if (artifact)
- engine->addPropertyRequestedFromArtifact(artifact, p);
- else
- engine->addPropertyRequestedInScript(p);
// Cache the variant value. We must not cache the QScriptValue here, because it's a
// reference and the user might change the actual object.
@@ -96,6 +90,14 @@ static QScriptValue getModuleProperty(const ResolvedProduct *product, const Arti
} else if (isPresent) {
*isPresent = true;
}
+
+ const Property p(product->uniqueName(), moduleName, propertyName, value,
+ Property::PropertyInModule);
+ if (artifact)
+ engine->addPropertyRequestedFromArtifact(artifact, p);
+ else
+ engine->addPropertyRequestedInScript(p);
+
return engine->toScriptValue(value);
}