ScriptUtil.eval
执行Javascript脚本,参数为脚本字符串。
栗子:ScriptUtil.eval("print('Script test!');");
ScriptUtil.compile
编译脚本,返回一个CompiledScript
对象
栗子:CompiledScript script = ScriptUtil.compile("print('Script test!');");
try {
script.eval();
} catch (ScriptException e) {
throw new ScriptRuntimeException(e);
}