Re: [gwt-contrib] NodeList and JsArrayList.asArray

2017-08-02 Thread Tony BenBrahim
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

Re: [gwt-contrib] NodeList and JsArrayList.asArray

2017-08-02 Thread 'Goktug Gokdogan' via GWT Contributors
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[]

Re: [gwt-contrib] NodeList and JsArrayList.asArray

2017-08-02 Thread Vassilis Virvilis
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

Re: [gwt-contrib] NodeList and JsArrayList.asArray

2017-07-31 Thread 'Goktug Gokdogan' via GWT Contributors
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

Re: [gwt-contrib] NodeList and JsArrayList.asArray

2017-07-24 Thread 'Goktug Gokdogan' via GWT Contributors
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.

[gwt-contrib] NodeList and JsArrayList.asArray

2017-07-23 Thread Colin Alworth
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