From 6ec5aa1a42a28f23e9e436ded67550824a31628f Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Mon, 23 Jun 2025 15:44:20 +0200 Subject: [PATCH] Remove workaround for passing functional interfaces to @JS methods --- .../wasm-javac/src/main/java/com/example/WebMain.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/native-image/wasm-javac/src/main/java/com/example/WebMain.java b/native-image/wasm-javac/src/main/java/com/example/WebMain.java index ad5b5cda..0f033638 100644 --- a/native-image/wasm-javac/src/main/java/com/example/WebMain.java +++ b/native-image/wasm-javac/src/main/java/com/example/WebMain.java @@ -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 -> { @@ -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. *