In my opinion, there is too much effort put in making Array behave like a
normal Java class when it is not. There are already plenty of good options
in GWT/Java for collections, arrays, etc…
A JavaScript Array is not equivalent to T[], for example this is a
perfectly fine JavaScript Array
Unfortunately jsinterop.base doesn't have github repo available yet so you
can't see the commut.
Change is asArray method is replaced with asList that looks like this:
@JsOverlay
default List asList() {
// Since it is hidden behind Arrays.asList, it is safe to do uncheckedCast.
T[]
Can you expand a little bit on this? Are there any consequences we need to
look for?
Is there a commit to look at?
On Mon, Jul 31, 2017 at 8:44 PM, 'Goktug Gokdogan' via GWT Contributors <
google-web-toolkit-contributors@googlegroups.com> wrote:
> It is fixed internally. asArray API replaced
It is fixed internally. asArray API replaced with asList API
On Mon, Jul 24, 2017 at 3:11 PM, Goktug Gokdogan wrote:
> For following code:
>
> class A {
> T[] asArray {}..
> }
>
> A st;
> String[] arr = st.asArray();
>
> I wasn't expecting an erasure cast at the call site
For following code:
class A {
T[] asArray {}..
}
A st;
String[] arr = st.asArray();
I wasn't expecting an erasure cast at the call site for this but seems like
I was wrong and erasure cast seems right here otherwise you cannot
guarantee that arr[0] which won't have a cast to return String.
Using GWT 2.8.1, I'm trying to iterate through items found via a query
selector:
Arrays.asList(document.querySelectorAll("button.with-some-class").asArray
()).forEach(
item -> doSomething(item)
);
Unfortunately, this seems to always fail - querySelectorAll returns a
NodeList, and while