I'm struggling to understand how "native method" calls in DukeScript work. In particular, the ones where no body is specified in the @JavascriptBody annotation. For example:
@JavaScriptResource(value = "userEntryComponent.js")
public final class UserEntryWidget {
private UserEntryWidget() {
}
@JavaScriptBody(args = {}, body = "")
public static native void registerComponent();
}
Where is the "registerComponent()" method defined? In knockout there's a javascript function called "ko.components.register". So "registerComponent" must be a sort of wrapper around "ko.components.register".
Another example of a native method call without body is here:
@JavaScriptResource("jquery-1.11.0.min.js")
public class JQuery {
@JavaScriptBody(args = {},body="")
public static native void init();
}
So, in this case, what's "init()"? is it a Java method or a JavaScript function?