Try using this$static
It's the object holding the members and state of instances passed as argument to functions that used to be class members but GWT compiles them to regular js functions
static members
GWT will convert static functions to just functions (not under any object in js)
public class SomeEntry implements EntryPoint {
public static String Moo() {
String href = Window.Location.getHref();
return href.substring(5, 10);
}
public static String Moo(String x) {
String href = Window.Location.getHref();
return href.substring(5, 10);
}
public void onModuleLoad() {
Window.alert(Moo());
Window.alert(Moo("asd"));
}
}
Will be compiled to:
function Moo(){
var href_0;
href_0 = getHref();
return $substring_0(href_0, 5, 10);
}
function Moo_0(){
var href_0;
href_0 = getHref();
return $substring_0(href_0, 5, 10);
}
So overloading which is resolved at compile time will work in JS. This has the benefit of not requiring referral using the dot operator. Each dot is a new lookup.