This commit is contained in:
kunfei 2023-03-26 19:48:28 +08:00
parent 74f0c2a97e
commit 37227b81ab
2 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,9 @@ class JsTest {
val jsMap = "$=result;id=$.id;id"
val result = SCRIPT_ENGINE.eval(jsMap, bindings)?.toString()
Assert.assertEquals("3242532321", result)
val jsMap1 = """result.get("id")"""
val result1 = SCRIPT_ENGINE.eval(jsMap1, bindings)?.toString()
Assert.assertEquals("3242532321", result1)
}
@Test

View File

@ -269,7 +269,6 @@ class RhinoScriptEngine : AbstractScriptEngine(), Invocable, Compilable {
override fun hasFeature(cx: Context, featureIndex: Int): Boolean {
return when (featureIndex) {
Context.FEATURE_ENABLE_JAVA_MAP_ACCESS -> true
Context.FEATURE_ENHANCED_JAVA_ACCESS -> true
else -> super.hasFeature(cx, featureIndex)
}
}