Re: Preventing obfuscation/inlining of a single function during GWT compilation

2021-11-05 Thread Jens
There is an annotation called 'DoNotInline' and acts as a compiler hint. So 
maybe you can fork GWT and apply that annotation to the method. But then 
you could also just change the implementation of the method to fit your 
needs.

Obfuscation itself can only be enabled/disabled globally. The only thing 
that is possible is to use JsInterop which allows you to define 
interfaces/classes that are either implemented in JS and you just want to 
access that implementation or should be exported to JS (without obfuscation 
then obviously) so that plain JS can call into GWT code. But not sure if 
hasTypeMarker() can be marked as such.

-- J.

Developer2011 schrieb am Freitag, 5. November 2021 um 00:15:39 UTC+1:

>
> To solve an issue, it would greatly simplify things to prevent the GWT 
> compiler from inlining and obfuscating the internal GWT function 
> hasTypeMarker().  That way, we can replace it in our own code.  (Yes, not 
> guaranteed to work, we know.)
>
> Is there any fine-grained control like this? We don't want to have to 
> disable obfuscation and inlining for everything.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/a99538e1-4f70-49e8-9118-faaf15a123e0n%40googlegroups.com.


Re: jsConstructor returns undefined

2021-11-05 Thread Jens
You can use jsinterop-base library. It has a method 
'Js.asConstructorFn(Class)'

-- J.

pavel@gmail.com schrieb am Dienstag, 2. November 2021 um 09:49:41 UTC+1:

> Hi all,
>
> I have noticed that the next code returns the undefined value in gwt 2.9.0
>
> public static native  Object getCtorFn(Class cls) /*-{
> $wnd.console.log(cls)
> $wnd.console.log(c...@java.lang.Class::jsConstructor)
>
> return c...@java.lang.Class::jsConstructor;
> }-*/;
>
> Does someone know is jsConstroctor still supported?
> Or could be there is another way to achieve the same
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/3d3174c4-9fa8-4cc2-8208-28779434326bn%40googlegroups.com.


Re: jsConstructor returns undefined

2021-11-05 Thread Thomas Broyer


On Friday, November 5, 2021 at 10:33:00 AM UTC+1 Jens wrote:

> You can use jsinterop-base library. It has a method 
> 'Js.asConstructorFn(Class)'


…which uses c...@java.lang.Class::jsConstructor, so if it's null/undefined 
in your own JSNI, there's no reason it won't be in jsinterop-base's 
JSNI: 
https://github.com/google/jsinterop-base/blob/3db256c87fea1b90786451b1814f6354bb39f370/java/jsinterop/base/InternalJsUtil.java#L164-L166
🤔
 

> -- J.
>
> pavel@gmail.com schrieb am Dienstag, 2. November 2021 um 09:49:41 
> UTC+1:
>
>> Hi all,
>>
>> I have noticed that the next code returns the undefined value in gwt 2.9.0
>>
>> public static native  Object getCtorFn(Class cls) /*-{
>> $wnd.console.log(cls)
>> $wnd.console.log(c...@java.lang.Class::jsConstructor)
>>
>> return c...@java.lang.Class::jsConstructor;
>> }-*/;
>>
>> Does someone know is jsConstroctor still supported?
>> Or could be there is another way to achieve the same
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/5cab2875-da01-4482-8046-b31d201b94b6n%40googlegroups.com.