源添加jsLib,未完成

This commit is contained in:
kunfei
2023-04-09 22:16:44 +08:00
parent e4e24f2520
commit f20bb539ce
3 changed files with 18 additions and 18 deletions
@@ -0,0 +1,18 @@
package io.legado.app.help.rhino
import org.mozilla.javascript.Context
object RhinoScriptEngine {
fun run(function: (Context) -> Any?): Any? {
return try {
val context = Context.enter()
function.invoke(context)
} finally {
Context.exit()
}
}
}