优化
This commit is contained in:
1 parent
bd870c399c
commit
09a0c7eda9
11 files changed
+105
-7
No files matched your search
@@ -6,6 +6,7 @@ package com.script
|
||||
import org.mozilla.javascript.Scriptable
|
||||
import java.io.Reader
|
||||
import java.io.StringReader
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
abstract class AbstractScriptEngine(val bindings: Bindings? = null) : ScriptEngine {
|
||||
|
||||
@@ -64,6 +65,10 @@ abstract class AbstractScriptEngine(val bindings: Bindings? = null) : ScriptEngi
|
||||
return this.eval(reader, getRuntimeScope(context))
|
||||
}
|
||||
|
||||
override fun eval(script: String, scope: Scriptable, coroutineContext: CoroutineContext?): Any? {
|
||||
return this.eval(StringReader(script), scope, coroutineContext)
|
||||
}
|
||||
|
||||
@Throws(ScriptException::class)
|
||||
override fun eval(reader: Reader, bindings: Bindings): Any? {
|
||||
return this.eval(reader, getScriptContext(bindings))
|
||||
|
||||
Reference in new issue
Block a user