>From JSONParser.createObject:
} else if (o instanceof Array || o instanceof $wnd.Array) {
// Looks like an Array; wrap as JSONArray.
// NOTE: this test can fail for objects coming from a different
window,
// but we know of no reliable tests to determine if something is
an Array
// in all cases.
return @com.google.gwt.json.client.JSONArray::new(Lcom/google/
gwt/core/client/JavaScriptObject;)(o);
Fortunately, Mark Miller (a Googler!) found a reliable solution:
Object.prototype.toString.apply(value) === '[object Array]'
See Doug Crockford's comment:
http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=916
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---