This commit is contained in:
kunfei
2023-03-26 08:56:02 +08:00
parent b6a2fc4d93
commit a9870a0ddb
+5 -1
View File
@@ -41,7 +41,11 @@ class JsTest {
fun testFor() { fun testFor() {
val context = SCRIPT_ENGINE.getScriptContext(SimpleBindings()) val context = SCRIPT_ENGINE.getScriptContext(SimpleBindings())
val scope = SCRIPT_ENGINE.getRuntimeScope(context) val scope = SCRIPT_ENGINE.getRuntimeScope(context)
Context.enter().evaluateString(scope, printJs, "print", 1, null) try {
Context.enter().evaluateString(scope, printJs, "print", 1, null)
} finally {
Context.exit()
}
@Language("js") @Language("js")
val jsFor = """ val jsFor = """
let result = 0 let result = 0