From 68911d57b06eede061ad173df43322998c4a8d45 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 25 Jun 2018 14:47:13 +0200 Subject: 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 --- src/lib/corelib/jsextensions/moduleproperties.cpp | 14 ++++++++------ 1 file 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); } -- cgit v1.2.3