fix handling of java-arrays
This commit is contained in:
parent
0d5b001230
commit
bc14a31133
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user