fix handling of java-arrays

This commit is contained in:
Peter Hormanns 2015-01-14 13:18:35 +01:00
parent 0d5b001230
commit bc14a31133

View File

@ -1,3 +1,4 @@
importClass(java.util.Arrays);
importClass(java.util.ArrayList);
importClass(java.util.HashMap);
@ -51,6 +52,7 @@ function hsaParseParamObject(o) {
}
function hsaToNativeJSObject(val) {
if (val instanceof java.lang.Object) {
if (val instanceof java.util.List) {
var res = [];
for (var i = 0; i < val.size(); i++) {
@ -67,6 +69,15 @@ function hsaToNativeJSObject(val) {
}
return res;
}
var classSimpleName = val.getClass().getSimpleName();
if (classSimpleName == 'Object[]') {
var res = [];
for (var i = 0; i < val.length; i++) {
res[i] = hsaToNativeJSObject(val[i]);
}
return res;
}
}
return val;
}