|
|
@@ -74,33 +74,6 @@ class RhinoScriptEngine : AbstractScriptEngine(), Invocable, Compilable {
|
|
|
return unwrapReturnValue(ret)
|
|
|
}
|
|
|
|
|
|
- @Throws(ScriptException::class)
|
|
|
- override fun eval(reader: Reader, context: ScriptContext): Any? {
|
|
|
- val cx = Context.enter()
|
|
|
- val ret: Any?
|
|
|
- try {
|
|
|
- val scope = getRuntimeScope(context)
|
|
|
- var filename = this["javax.script.filename"] as? String
|
|
|
- filename = filename ?: "<Unknown source>"
|
|
|
- ret = cx.evaluateReader(scope, reader, filename, 1, null)
|
|
|
- } catch (re: RhinoException) {
|
|
|
- val line = if (re.lineNumber() == 0) -1 else re.lineNumber()
|
|
|
- val msg: String = if (re is JavaScriptException) {
|
|
|
- re.value.toString()
|
|
|
- } else {
|
|
|
- re.toString()
|
|
|
- }
|
|
|
- val se = ScriptException(msg, re.sourceName(), line)
|
|
|
- se.initCause(re)
|
|
|
- throw se
|
|
|
- } catch (var14: IOException) {
|
|
|
- throw ScriptException(var14)
|
|
|
- } finally {
|
|
|
- Context.exit()
|
|
|
- }
|
|
|
- return unwrapReturnValue(ret)
|
|
|
- }
|
|
|
-
|
|
|
override fun createBindings(): Bindings {
|
|
|
return SimpleBindings()
|
|
|
}
|