}
return ((Number) value).longValue();
}
if (value instanceof NativeArray) {
final NativeArray array = (NativeArray)value;
JavaScriptResultsCollection collection = new JavaScriptResultsCollection() {
public int getLength() { return (int) array.getLength(); }
public Object item(int index) { return array.get(index); }
};
return parseJavascriptResultsList(collection);
}
if (value instanceof HTMLCollection) {
final HTMLCollection array = (HTMLCollection) value;
JavaScriptResultsCollection collection = new JavaScriptResultsCollection() {
public int getLength() { return array.getLength(); }
public Object item(int index) { return array.get(index); }
};
return parseJavascriptResultsList(collection);
}