Saturday, November 30, 2019

Re: Adding u2f to js.identifier.blacklist



On Saturday, November 30, 2019 at 1:34:19 AM UTC+1, Axel wrote:
The obfuscator does not have "u2f" as a blacklisted identifier. In conjunction with a Firefox that now (>=67) has U2F enabled by default (see about:config, security.webauth.u2f) the identifier "window.u2f" is made available. When the obfuscator uses u2f as an output symbol, weird things can happen, such as properties that are expected to be found on the object bound to the obfuscated "u2f" identifier not being found because u2f points to the U2F object and not the application object.

In our project we work around this by adding

   <extend-configuration-property name="js.identifier.blacklist" value="u2f"/>

to a base module that all our modules inherit. I think this should become part of the standard as it is error prone and incredibly time-consuming to figure out the root cause of the errors that can result.

It is. It just hasn't been released yet: https://github.com/gwtproject/gwt/issues/9619 

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/ec6136d4-dfc6-480b-adb2-314be37acca8%40googlegroups.com.

Friday, November 29, 2019

Adding u2f to js.identifier.blacklist

The obfuscator does not have "u2f" as a blacklisted identifier. In conjunction with a Firefox that now (>=67) has U2F enabled by default (see about:config, security.webauth.u2f) the identifier "window.u2f" is made available. When the obfuscator uses u2f as an output symbol, weird things can happen, such as properties that are expected to be found on the object bound to the obfuscated "u2f" identifier not being found because u2f points to the U2F object and not the application object.

In our project we work around this by adding

   <extend-configuration-property name="js.identifier.blacklist" value="u2f"/>

to a base module that all our modules inherit. I think this should become part of the standard as it is error prone and incredibly time-consuming to figure out the root cause of the errors that can result.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/470b1dd1-4133-464c-b523-7feab71f87ba%40googlegroups.com.

Thursday, November 28, 2019

Re: JsFunction length is zero

ok then.


I will try to come with a patch in the next few days.

Thanks

  Vassilis

On Thu, Nov 28, 2019 at 9:38 AM Jens <jens.nehlmeier@gmail.com> wrote:

Do you think a patch like that has any chance to be accepted? or this is not considered to be an issue?

Seems like a valid behavior for JS libraries to check argument count, so I guess it should be accepted. Goktug or Roberto should probably review it.

-- J.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com.


--
Vassilis Virvilis

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExjVWLLBO%3DJHgiudD6g%2BDtSc-PGnj%3DWdH%3DPWh43ugu8ww%40mail.gmail.com.

Wednesday, November 27, 2019

Re: JsFunction length is zero


Do you think a patch like that has any chance to be accepted? or this is not considered to be an issue?

Seems like a valid behavior for JS libraries to check argument count, so I guess it should be accepted. Goktug or Roberto should probably review it.

-- J.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/9232cdec-c84f-427a-a019-d0cef9262244%40googlegroups.com.

Re: JsFunction length is zero

Hi Jens,

Thanks for the reply and the pointer. Your answers are spot on as always but in this case I had managed to find the specific code fragment by my self.

I was thinking a patch could look like the accepted answer in this Stack Overflow question: https://stackoverflow.com/questions/7316688/how-to-programmatically-set-the-length-of-a-function

assuming arguments and arguments.length carry the necessary information.

Do you think a patch like that has any chance to be accepted? or this is not considered to be an issue?

Thanks



On Wed, Nov 27, 2019 at 1:57 PM Jens <jens.nehlmeier@gmail.com> wrote:
You can see here how GWT compiler creates lambdas: https://github.com/gwtproject/gwt/blob/master/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Runtime.java#L162

In case you also want to try to fix the issue ;-)

-- J.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/e6e9e9ea-e921-41c7-9283-9734902e3d41%40googlegroups.com.


--
Vassilis Virvilis

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzsNhqhPWbUQENie-mx-g-pMYWs-09vt5w8fqbf8qnUDQ%40mail.gmail.com.

Re: JsFunction length is zero

You can see here how GWT compiler creates lambdas: https://github.com/gwtproject/gwt/blob/master/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Runtime.java#L162

In case you also want to try to fix the issue ;-)

-- J.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/e6e9e9ea-e921-41c7-9283-9734902e3d41%40googlegroups.com.

Tuesday, November 26, 2019

JsFunction length is zero

Hi,

Looks like that some javascript libraries are checking on the argument length of the callbacks that are passed to them.

So for example D3 bisector can take a function with one or two arguments. If it is one then it is an accessor if it is two then it is a comparator.

I searched on github issues. Should I report it?

The following snippet demonstrates the problem. The Function.length should be 1 and not 0.

    @JsFunction      public static interface SomeFunction {          public double call(double x);      }  
    /**      * This is the entry point method.      */     @Override     public void onModuleLoad() {         final SomeFunction y = new SomeFunction() {             @Override             public double call(double x) {                 return 2 * x;             }         };         DomGlobal.console.log(y);         return;    }


--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEzhR%3DGgF8S7SMmpq9WzjmqViKjZtcWLCKMp%3DaK0uZmHLQ%40mail.gmail.com.