mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-04 21:01:01 +08:00
Merge pull request #23 from vtrayy/vtrayy-patch-1
Some checks failed
Android CI / build (push) Has been cancelled
Some checks failed
Android CI / build (push) Has been cancelled
修复java基本类型映射到js变为包装类型 #21
This commit is contained in:
commit
2fd2cd000e
@ -205,10 +205,12 @@ open class RhinoJavaScriptEngine(private val mAndroidContext: android.content.Co
|
||||
}
|
||||
|
||||
private inner class WrapFactory : org.mozilla.javascript.WrapFactory() {
|
||||
init {
|
||||
isJavaPrimitiveWrap = false
|
||||
}
|
||||
|
||||
override fun wrap(cx: Context, scope: Scriptable, obj: Any?, staticType: Class<*>?): Any? {
|
||||
return when {
|
||||
obj is String -> runtime.bridges.toString(obj.toString())
|
||||
staticType == UiObjectCollection::class.java -> runtime.bridges.asArray(obj)
|
||||
else -> {
|
||||
if (scope is TopLevelScope) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user