From dcd1f64c812763c161161fcd95d1c5a35c17127a Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 7 Aug 2019 18:34:06 +0300 Subject: [PATCH] JS: fix instanceof T[], where T is non-primitive type --- .../src/main/resources/org/teavm/backend/javascript/runtime.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/resources/org/teavm/backend/javascript/runtime.js b/core/src/main/resources/org/teavm/backend/javascript/runtime.js index b612018f6..cb05e8e86 100644 --- a/core/src/main/resources/org/teavm/backend/javascript/runtime.js +++ b/core/src/main/resources/org/teavm/backend/javascript/runtime.js @@ -33,6 +33,9 @@ function $rt_isAssignable(from, to) { if (from === to) { return true; } + if (to.$meta.item !== null) { + return from.$meta.item !== null && $rt_isAssignable(from.$meta.item, to.$meta.item); + } var supertypes = from.$meta.supertypes; for (var i = 0; i < supertypes.length; i = (i + 1) | 0) { if ($rt_isAssignable(supertypes[i], to)) {