File tree 2 files changed +13
-8
lines changed
gwt-core/src/main/java/org/gwtproject/core/client
gwt-core-gwt2-tests/src/test/java/org/gwtproject/core/client
2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public void testReportUncaughtError() {
45
45
DomGlobal .setTimeout (
46
46
(ignore ) -> {
47
47
assertEquals (1 , caught .size ());
48
- assertEquals ("java.lang.JsException " , caught .get (0 ).getClass ().getName ());
48
+ assertEquals ("java.lang.RuntimeException " , caught .get (0 ).getClass ().getName ());
49
49
finishTest ();
50
50
},
51
51
1000 );
Original file line number Diff line number Diff line change 17
17
18
18
import elemental2 .dom .DomGlobal ;
19
19
import elemental2 .dom .Window ;
20
+ import jsinterop .annotations .JsFunction ;
20
21
import jsinterop .annotations .JsMethod ;
21
22
import jsinterop .annotations .JsType ;
22
23
import jsinterop .base .Js ;
@@ -58,11 +59,10 @@ public static <T> T create(Class<?> clazz) {
58
59
public static void reportUncaughtException (Throwable e ) {
59
60
// throw an exception "later" so that it ends up handled by the global
60
61
// error handler. Same code as in GWT2's Impl.reportToBrowser()
61
- DomGlobal .setTimeout (
62
- ignore -> {
63
- throw_ (e );
64
- },
65
- 0 );
62
+ setTimeout (
63
+ () -> {
64
+ throw e ;
65
+ });
66
66
}
67
67
68
68
/**
@@ -160,8 +160,13 @@ private static class InnerWindow {
160
160
static Window window ;
161
161
}
162
162
163
- @ JsMethod (namespace = "<window>" , name = "throw" )
164
- private static native void throw_ (Object object );
163
+ @ JsFunction
164
+ private interface Throwing {
165
+ void run () throws Throwable ;
166
+ }
167
+
168
+ @ JsMethod (namespace = "<window>" , name = "setTimeout" )
169
+ private static native void setTimeout (Throwing throwingFunction );
165
170
166
171
public static boolean isClient () {
167
172
return org .gwtproject .core .shared .GWT .isClient ();
You can’t perform that action at this time.
0 commit comments