diff options
author | Richard Weickelt <richard@weickelt.de> | 2021-02-13 16:00:25 +0100 |
---|---|---|
committer | Richard Weickelt <richard@weickelt.de> | 2021-02-15 21:38:33 +0000 |
commit | f8c18f9a4e2906330638f17f612ee62325a88dc0 (patch) | |
tree | f7810768d3fa17da54c15d77d1db5f469f11bc53 /share/qbs/modules/java/JavaModule.qbs | |
parent | 91c2a99b81c2c3fc6a22787c3b471a47515abf00 (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/java/JavaModule.qbs')
-rw-r--r-- | share/qbs/modules/java/JavaModule.qbs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/share/qbs/modules/java/JavaModule.qbs b/share/qbs/modules/java/JavaModule.qbs index 71f7d8432..c3efb15bf 100644 --- a/share/qbs/modules/java/JavaModule.qbs +++ b/share/qbs/modules/java/JavaModule.qbs @@ -240,7 +240,7 @@ Module { if (!product.java._tagJniHeaders) { for (var i = 0; i < artifacts.length; ++i) { var a = artifacts[i]; - if (Array.isArray(a.fileTags)) + if (a.fileTags instanceof Array) a.fileTags = a.fileTags.filter(function(tag) { return tag != "hpp"; }); } } |