aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorRichard Weickelt <richard@weickelt.de>2021-01-01 23:27:34 +0100
committerRichard Weickelt <richard@weickelt.de>2021-01-05 06:52:49 +0000
commit6b949530541ed483fbbea3cf6275cb06e6fe1d97 (patch)
treed24b0f3d7ebf3a25b53a945e2edba37d86ad4d89 /share
parent0b23c1f139a00643521b35f77acfa333b4073194 (diff)
Do not modify the product object
Since the script creates and modifies a local 'imports' variable, the local variable should also be used for iteration. Otherwise we rely on 'imports' being a reference only. While this is the way how copying objects works in JS, it is still not clean, especially since we view the product object as read-only. Change-Id: I1ffe61e03b793d5ed36d069e983014172db85463 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/Exporter/qbs/qbsexporter.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/qbs/modules/Exporter/qbs/qbsexporter.js b/share/qbs/modules/Exporter/qbs/qbsexporter.js
index 015ed4418..d3cdb7c03 100644
--- a/share/qbs/modules/Exporter/qbs/qbsexporter.js
+++ b/share/qbs/modules/Exporter/qbs/qbsexporter.js
@@ -267,6 +267,6 @@ function writeImportStatements(product, moduleFile)
if (!imports.contains("import qbs.FileInfo"))
imports.push("import qbs.FileInfo");
- for (var i = 0; i < product.exports.imports.length; ++i)
- moduleFile.writeLine(product.exports.imports[i]);
+ for (var i = 0; i < imports.length; ++i)
+ moduleFile.writeLine(imports[i]);
}