Wednesday, May 24, 2017

JsInterop and Function.prototype.apply 'this' argument


as you probably know, in plain JS methods like apply or call allow you to pass any object for "this". Now, some JS libraries provide methods where you can pass some callback function, which is performed after some operation has finished. Some libraries choose to pass some special object for "this" which is not contained in the argument list. It is always documented how this object will look like, which means it can be mapped to some JsType.

But in the JsInterop world, is there a way that a @JsFunction can access "this" objects. I didn't find any suitable annotation for that. Is this even possible with JsInterop, or is it considered bad practice?
I actually managed to workaround it, using some JSNI code, but we know, this is not the future..

Thx in advance

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
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment