Re: JsInterop and indexed types

2016-01-27 Thread Kirill Prazdnikov
Hi Alex, really thanks for excellent answers. I'm writing portable code. This is the reason why I can not use JS TypedArrays directly. My code must work in GWT, RoboVM and Android. I'm looking for writing code in Java once and run it with best possible efficiency on all platforms. In RoboVM plat

Re: JsInterop and indexed types

2016-01-27 Thread Alexey Andreev
> > > Sorry for by bad english. > I meant a different thing. > > Oh, now I see. Well, making Java array equal to JavaScript array is not an only solution for passing direct reference to an array. TeaVM could have a method to "unwrap" array, giving a native code reference to `data` field. There

Re: JsInterop and indexed types

2016-01-27 Thread Kirill Prazdnikov
On Saturday, January 23, 2016 at 11:09:50 AM UTC+3, Alexey Andreev wrote: > > >> Famous TeaVM also can`t do that, unfortunately. >> > You are wrong. You can do that via @JSIndexer > > > annotation. >

Re: JsInterop and indexed types

2016-01-23 Thread Alexey Andreev
> > > Famous TeaVM also can`t do that, unfortunately. > You are wrong. You can do that via @JSIndexer annotation. TeaVM java array class has a field "data" with the underlying native array, > so that

Re: JsInterop and indexed types

2016-01-21 Thread Jens
Even the old spec wasn't able to do that directly without using a helper method that maps to a one liner of JSNI code [1]. So with the current 1.0 spec you probably need to do @JsType(isNative = true) public class UintArray { public UintArray(int size) {} @JsOverlay public void set(int

Re: JsInterop and indexed types

2016-01-21 Thread Kirill Prazdnikov
Yes, this is really needed. Also it is needed to have a compiler switch that compiles all java arrays an native typed arrays. So that I can write code in Java, and use native platform arrays when needed in Graphics and Sound (expect all java arrays to be native typed arrays in JS) Famous TeaV

JsInterop and indexed types

2016-01-20 Thread rhmoller
Hi Is there any way of mapping to indexed types via JsInterop. Fx to model Uint8Array var uint8 = new Uint8Array(2); uint8[0] = 42; I have not any luck so far. /Rene -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this grou