This commit is contained in:
kunfei
2023-04-17 10:46:16 +08:00
parent a4fc1b10f5
commit 19840997bd
@@ -5,9 +5,8 @@ import org.mozilla.javascript.Context
object Rhino { object Rhino {
inline fun <R> use(block: Context.() -> R): R { inline fun <R> use(block: Context.() -> R): R {
val context = Context.enter()
return try { return try {
block.invoke(context) block.invoke(Context.enter())
} finally { } finally {
Context.exit() Context.exit()
} }