源添加jsLib,未完成

This commit is contained in:
kunfei
2023-04-09 22:04:51 +08:00
parent bbe8d95a5a
commit 4e7f2a52e5
10 changed files with 1924 additions and 26 deletions

View File

@@ -48,6 +48,15 @@ class RhinoScriptEngine : AbstractScriptEngine(), Invocable, Compilable {
private val indexedProps: MutableMap<Any, Any?>
private val implementor: InterfaceImplementor
fun run(function: (Context) -> Any?): Any? {
return try {
val context = Context.enter()
function.invoke(context)
} finally {
Context.exit()
}
}
@Throws(ScriptException::class)
override fun eval(reader: Reader, scope: Scriptable): Any? {
val cx = Context.enter()