# HG changeset patch # User Jaroslav Tulach # Date 1407867350 -7200 # Node ID ec0ee77173e9567bc7e8f9aadfc3b4a86097bda5 # Parent 335691ea97147184367ffd4a958d8121471be7c5 Don't mangle with JavaScript when debugging Java only method diff -r 335691ea9714 -r ec0ee77173e9 rt/vm8/src/test/java/org/apidesign/bck2brwsr/vm8/InvokeDynamicTest.java --- a/rt/vm8/src/test/java/org/apidesign/bck2brwsr/vm8/InvokeDynamicTest.java Tue Aug 12 19:22:39 2014 +0200 +++ b/rt/vm8/src/test/java/org/apidesign/bck2brwsr/vm8/InvokeDynamicTest.java Tue Aug 12 20:15:50 2014 +0200 @@ -56,13 +56,25 @@ } @Test public void simpleDynamicInJS() throws Exception { - code.assertExec( + code().assertExec( "Invoke dynamic can return a value", InvokeDynamic.class, "dynamicSay__Ljava_lang_String_2", "Hello from Dynamic!" ); } + private TestVM code() throws Exception { + if (code == null) { + final EmulResWithInvDyn emul = new EmulResWithInvDyn(); + code = TestVM.compileClass( + null, null, emul, + InvokeDynamic.class.getName().replace('.', '/') + ); + + assertTrue(emul.loaded, "InvokeDynamic class should be processed!"); + } + return code; + } @AfterClass public static void releaseTheCode() { @@ -115,14 +127,6 @@ }; invokeDynamicClass = l.loadClass(InvokeDynamic.class.getName()); assertTrue(loaded[0], "InvokeDynamic class should be loaded!"); - - final EmulResWithInvDyn emul = new EmulResWithInvDyn(); - code = TestVM.compileClass( - null, null, emul, - InvokeDynamic.class.getName().replace('.', '/') - ); - - assertTrue(emul.loaded, "InvokeDynamic class should be processed!"); }