This commit is contained in:
Horis
2025-04-07 17:52:25 +08:00
parent adb2679d31
commit c33939e148

View File

@@ -89,9 +89,11 @@ internal class RhinoCompiledScript(
}
override suspend fun evalSuspend(scope: Scriptable): Any? {
val cx = Context.enter()
val cx = Context.enter() as RhinoContext
var ret: Any?
withContext(VMBridgeReflect.contextLocal.asContextElement()) {
cx.allowScriptRun = true
cx.recursiveCount++
try {
try {
ret = cx.executeScriptWithContinuations(script, scope)
@@ -126,6 +128,8 @@ internal class RhinoCompiledScript(
} catch (var14: IOException) {
throw ScriptException(var14)
} finally {
cx.allowScriptRun = false
cx.recursiveCount--
Context.exit()
}
}