优化
This commit is contained in:
@@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user