aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/Exporter
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules/Exporter')
-rw-r--r--share/qbs/modules/Exporter/pkgconfig/pkgconfig.js8
-rw-r--r--share/qbs/modules/Exporter/qbs/qbsexporter.js6
2 files changed, 7 insertions, 7 deletions
diff --git a/share/qbs/modules/Exporter/pkgconfig/pkgconfig.js b/share/qbs/modules/Exporter/pkgconfig/pkgconfig.js
index a3109d61d..52b4dffe3 100644
--- a/share/qbs/modules/Exporter/pkgconfig/pkgconfig.js
+++ b/share/qbs/modules/Exporter/pkgconfig/pkgconfig.js
@@ -44,9 +44,9 @@ function writeEntry(product, file, key, propertyName, required, additionalValues
var value = product.Exporter.pkgconfig[propertyName];
if (additionalValues && additionalValues.length > 0)
value = (value || []).concat(additionalValues);
- var valueIsNotEmpty = value && (!Array.isArray(value) || value.length > 0);
+ var valueIsNotEmpty = value && (!(value instanceof Array) || value.length > 0);
if (valueIsNotEmpty) {
- if (Array.isArray(value))
+ if (value instanceof Array)
value = value.join(' ');
file.writeLine(key + ": " + value);
} else if (required) {
@@ -83,7 +83,7 @@ function collectAutodetectedData(topLevelProduct)
|| (value.length > installPrefix.length && value[installPrefix.length] !== '/')) {
return quotedValue;
}
- return quotedValue.replace(product.qbs.installPrefix, "${prefix}");
+ return quotedValue.replace(topLevelProduct.qbs.installPrefix, "${prefix}");
}
function transformedValue(product, moduleName, propertyName)
@@ -92,7 +92,7 @@ function collectAutodetectedData(topLevelProduct)
var value = transformFunc
? eval("(" + transformFunc + ")(product, moduleName, propertyName, originalValue)")
: originalValue;
- if (Array.isArray(value))
+ if (value instanceof Array)
value.forEach(function(v, i, a) { a[i] = quoteAndPrefixify(v); });
else if (value)
value = quoteAndPrefixify(value);
diff --git a/share/qbs/modules/Exporter/qbs/qbsexporter.js b/share/qbs/modules/Exporter/qbs/qbsexporter.js
index 015ed4418..be46372c3 100644
--- a/share/qbs/modules/Exporter/qbs/qbsexporter.js
+++ b/share/qbs/modules/Exporter/qbs/qbsexporter.js
@@ -113,7 +113,7 @@ function checkValuePrefix(name, value, forbiddenPrefix, prefixDescription)
function stringifyValue(project, product, moduleInstallDir, prop, value)
{
- if (Array.isArray(value)) {
+ if (value instanceof Array) {
var repr = "[";
for (var i = 0; i < value.length; ++i) {
repr += stringifyValue(project, product, moduleInstallDir, prop, value[i]) + ", ";
@@ -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]);
}