Skip to content

Remove workaround for passing functional interfaces to @JS methods #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions native-image/wasm-javac/src/main/java/com/example/WebMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ public class WebMain {
public static void main(String[] args) {
// Ensure file manager is initialized
JavacCompilerWrapper.getFm();
try {
// TODO GR-62854 Here to ensure handleEvent and run is generated. Remove once objects
// passed to @JS methods automatically have their SAM registered.
sink(EventHandler.class.getDeclaredMethod("handleEvent", JSObject.class));
sink(Runnable.class.getDeclaredMethod("run"));
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}

addEventListener(COMPILE_BUTTON, "click", e -> compileCallback());
addEventListener(INPUT, "keydown", e -> {
Expand All @@ -67,9 +59,6 @@ private static void compileCallback() {
});
}

@JS("")
private static native void sink(Object o);

/**
* Runs the given {@link Runnable} in {@code setTimeout} without delay.
* <p>
Expand Down