diff --git a/src/main/java/com/eclipsesource/v8/utils/V8ObjectUtils.java b/src/main/java/com/eclipsesource/v8/utils/V8ObjectUtils.java index b43356585..f1a663741 100644 --- a/src/main/java/com/eclipsesource/v8/utils/V8ObjectUtils.java +++ b/src/main/java/com/eclipsesource/v8/utils/V8ObjectUtils.java @@ -552,6 +552,16 @@ private static V8Array toV8Array(final V8 v8, final List list, return result; } + private static List toList(Object array){ + int length=Array.getLength(array); + List list = new ArrayList<>(length); + + for(int i=0;i cache) { if (cache.containsKey(value)) { @@ -599,6 +609,9 @@ private static void pushValue(final V8 v8, final V8Array result, final Object va } else if (value instanceof List) { V8Array array = toV8Array(v8, (List) value, cache); result.push(array); + } else if (value.getClass().isArray()){ + V8Array array = toV8Array(v8, toList(value), cache); + result.push(array); } else { throw new IllegalStateException("Unsupported Object of type: " + value.getClass()); } @@ -634,6 +647,9 @@ private static void setValue(final V8 v8, final V8Object result, final String ke } else if (value instanceof List) { V8Array array = toV8Array(v8, (List) value, cache); result.add(key, array); + } else if (value.getClass().isArray()){ + V8Array array = toV8Array(v8, toList(value), cache); + result.add(key, array); } else { throw new IllegalStateException("Unsupported Object of type: " + value.getClass()); }