private static V8Array toV8Array(final V8 v8, final List<? extends Object> list, final Map<Object, V8Value> cache) { if (cache.containsKey(new ListWrapper(list))) { return (V8Array) cache.get(new ListWrapper(list)); } V8Array result = new V8Array(v8); cache.put(new ListWrapper(list), result); try { for (int i = 0; i < list.size(); i++) { Object value = list.get(i); pushValue(v8, result, value, cache); } } catch (IllegalStateException e) { result.close(); throw e; } return result; }
private static V8Array toV8Array(final V8 v8, final List<? extends Object> list, final Map<Object, V8Value> cache) { if (cache.containsKey(new ListWrapper(list))) { return (V8Array) cache.get(new ListWrapper(list)); } V8Array result = new V8Array(v8); cache.put(new ListWrapper(list), result); try { for (int i = 0; i < list.size(); i++) { Object value = list.get(i); pushValue(v8, result, value, cache); } } catch (IllegalStateException e) { result.release(); throw e; } return result; }
private static V8Array toV8Array(final V8 v8, final List<? extends Object> list, final Map<Object, V8Value> cache) { if (cache.containsKey(new ListWrapper(list))) { return (V8Array) cache.get(new ListWrapper(list)); } V8Array result = new V8Array(v8); cache.put(new ListWrapper(list), result); try { for (int i = 0; i < list.size(); i++) { Object value = list.get(i); pushValue(v8, result, value, cache); } } catch (IllegalStateException e) { result.release(); throw e; } return result; }
private static V8Array toV8Array(final V8 v8, final List<? extends Object> list, final Map<Object, V8Value> cache) { if (cache.containsKey(new ListWrapper(list))) { return (V8Array) cache.get(new ListWrapper(list)); } V8Array result = new V8Array(v8); cache.put(new ListWrapper(list), result); try { for (int i = 0; i < list.size(); i++) { Object value = list.get(i); pushValue(v8, result, value, cache); } } catch (IllegalStateException e) { result.close(); throw e; } return result; }