public native String debugString(JavaScriptObject array, int i) /*-{
return 'typeof=' + typeof array[i] + ' toString="' + array[i] + '"';
}-*/;
public JsArrayMixed toJso(List<Object> args) {
JsArrayMixed result = (JsArrayMixed) JavaScriptObject.createArray();
for (Object o : args) {
if (o == null) {
result.push((JavaScriptObject) null);
} else if (o instanceof String) {
result.push((String) o);
} else if (o instanceof Date) {
result.push(JsDate.create(((Date) o).getTime()));
} else if (o instanceof Double) {
result.push(((Double) o).doubleValue());
} else {
throw new IllegalArgumentException("Don't know how to handle "
+ o);
}
}