源添加jsLib,未完成

This commit is contained in:
kunfei committed 2023-04-09 22:16:44 +08:00
1 parent e4e24f2520
commit f20bb539ce
3 files changed
+18 -18

No files matched your search

@@ -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()
}
}
}