This commit is contained in:
kunfei
2023-04-20 21:22:24 +08:00
parent f1eccda865
commit 863b41ac4f
8 changed files with 146 additions and 21 deletions

View File

@@ -0,0 +1,15 @@
package com.script
import org.mozilla.javascript.Context
import org.mozilla.javascript.ContextFactory
open class RhinoContextFactory : ContextFactory() {
override fun hasFeature(cx: Context, featureIndex: Int): Boolean {
return when (featureIndex) {
Context.FEATURE_ENABLE_JAVA_MAP_ACCESS -> true
else -> super.hasFeature(cx, featureIndex)
}
}
}

View File

@@ -51,7 +51,7 @@ object RhinoClassShutter : ClassShutter {
if (i != -1) {
try {
sm.checkPackageAccess(fullClassName.substring(0, i))
} catch (var5: SecurityException) {
} catch (e: SecurityException) {
return false
}
}