Adding static callback into the TCK as some implementations seem to have problem with it
1.1 --- a/json-tck/src/main/java/net/java/html/js/tests/Bodies.java Tue Mar 04 21:57:50 2014 +0100
1.2 +++ b/json-tck/src/main/java/net/java/html/js/tests/Bodies.java Thu Mar 06 16:33:06 2014 +0100
1.3 @@ -104,4 +104,13 @@
1.4 "return s.@net.java.html.js.tests.Sum::sum([Ljava/lang/Object;)([1, 2, 3]);"
1.5 )
1.6 public static native int sumArr(Sum s);
1.7 +
1.8 + @JavaScriptBody(args = {}, javacall = true, body =
1.9 + "return @net.java.html.js.tests.Bodies::fourtyTwo()();"
1.10 + )
1.11 + public static native int staticCallback();
1.12 +
1.13 + static int fourtyTwo() {
1.14 + return 42;
1.15 + }
1.16 }
2.1 --- a/json-tck/src/main/java/net/java/html/js/tests/JavaScriptBodyTest.java Tue Mar 04 21:57:50 2014 +0100
2.2 +++ b/json-tck/src/main/java/net/java/html/js/tests/JavaScriptBodyTest.java Thu Mar 06 16:33:06 2014 +0100
2.3 @@ -280,6 +280,11 @@
2.4 assert r == 6 : "Sum is six: " + r;
2.5 }
2.6
2.7 + @KOTest public void staticCallback() {
2.8 + int r = Bodies.staticCallback();
2.9 + assert r == 42 : "Expecting 42: " + r;
2.10 + }
2.11 +
2.12 Later l;
2.13 @KOTest public void callLater() throws Exception{
2.14 final Fn.Presenter p = Fn.activePresenter();