private List < Object > convertArray ( V8Array arr ) { List < Object > l = new ArrayList <> ( ) ; for ( int i = 0 ; i < arr . length ( ) ; ++ i ) { Object o = arr . get ( i ) ; if ( o instanceof V8Array ) { o = convert ( ( V8Array ) o , List . class ) ; } else if ( o instanceof V8Object ) { o = convert ( ( V8Object ) o , Map . class ) ; } l . add ( o ) ; } return l ; }
Recursively convert a V8 array to a list and release it