aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/gcc.js
diff options
context:
space:
mode:
authorRichard Weickelt <richard@weickelt.de>2021-02-13 16:00:25 +0100
committerRichard Weickelt <richard@weickelt.de>2021-02-15 21:38:33 +0000
commitf8c18f9a4e2906330638f17f612ee62325a88dc0 (patch)
treef7810768d3fa17da54c15d77d1db5f469f11bc53 /share/qbs/modules/cpp/gcc.js
parent91c2a99b81c2c3fc6a22787c3b471a47515abf00 (diff)
Test for array-like objects with instanceof Array
Array.isArray() seemed to work for arrays created in scripts as well as for QStringList and QVariantList created in C++ when using QtScript. QJSEngine is more strict (see the comments in QTBUG-45018). One way to work around that problem is to use instanceof Array instead. Change-Id: I0f1c8757a5ab2f82e26eff19a8b5ecf667bb04b1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/gcc.js')
-rw-r--r--share/qbs/modules/cpp/gcc.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 2c7d0b128..f49609f94 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -132,7 +132,7 @@ function collectLibraryDependencies(product, isDarwin) {
if (!obj.cpp)
return;
function ensureArray(a) {
- return Array.isArray(a) ? a : [];
+ return (a instanceof Array) ? a : [];
}
function sanitizedModuleListProperty(obj, moduleName, propertyName) {
return ensureArray(ModUtils.sanitizedModuleProperty(obj, moduleName, propertyName));