evaluate a javascript String @param name the name of the script (for error messages) @param script the content of the script @return the result
(String name, String script)
| 129 | * @return the result |
| 130 | */ |
| 131 | public Object jsEval(String name, String script) { |
| 132 | try { |
| 133 | return getContext().evaluateString(scope, script, name, 1, null); |
| 134 | } catch (EcmaError e) { |
| 135 | throw new RuntimeException("can't evaluate "+name+": "+script,e); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * evaluate javascript from a reader |
no test coverage detected