1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java Tue Nov 20 21:24:01 2012 +0100
1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java Sun Nov 25 21:24:03 2012 +0100
1.3 @@ -271,12 +271,20 @@
1.4 }
1.5
1.6 static Invocable compileClass(StringBuilder sb, String... names) throws ScriptException, IOException {
1.7 + return compileClass(sb, null, names);
1.8 + }
1.9 + static Invocable compileClass(
1.10 + StringBuilder sb, ScriptEngine[] eng, String... names
1.11 + ) throws ScriptException, IOException {
1.12 if (sb == null) {
1.13 sb = new StringBuilder();
1.14 }
1.15 GenJS.compile(sb, names);
1.16 ScriptEngineManager sem = new ScriptEngineManager();
1.17 ScriptEngine js = sem.getEngineByExtension("js");
1.18 + if (eng != null) {
1.19 + eng[0] = js;
1.20 + }
1.21 try {
1.22 Object res = js.eval(sb.toString());
1.23 assertTrue(js instanceof Invocable, "It is invocable object: " + res);