-
Sub-task
-
Resolution: Not an Issue
-
P4
-
None
-
None
-
None
-
generic
-
generic
import java.io.*;
import javax.script.*;
public class Jtest6{
public static void main(String[] args){
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine js = factory.getEngineByName("JavaScript");
Object obj = null;
try {
obj = js.eval("function f(a){println(a);return a;}");
obj = js.eval("f(1)");
} catch (ScriptException e){
System.out.printf("exception %s\n",e);
}
}
}
results in
exception javax.script.ScriptException: ReferenceError: "println" is not defined in <eval> at line number 1
import javax.script.*;
public class Jtest6{
public static void main(String[] args){
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine js = factory.getEngineByName("JavaScript");
Object obj = null;
try {
obj = js.eval("function f(a){println(a);return a;}");
obj = js.eval("f(1)");
} catch (ScriptException e){
System.out.printf("exception %s\n",e);
}
}
}
results in
exception javax.script.ScriptException: ReferenceError: "println" is not defined in <eval> at line number 1