This commit is contained in:
kunfei
2023-03-21 19:32:51 +08:00
parent e81ae8617f
commit 3d251bbec4
@@ -118,7 +118,7 @@ internal class ExternalScriptable @JvmOverloads constructor(
} }
} }
override fun put(index: Int, start: Scriptable, value: Any) { override fun put(index: Int, start: Scriptable, value: Any?) {
if (start === this) { if (start === this) {
synchronized(this) { indexedProps.put(index, value) } synchronized(this) { indexedProps.put(index, value) }
} else { } else {
@@ -213,10 +213,10 @@ internal class ExternalScriptable @JvmOverloads constructor(
} }
var v = ScriptableObject.getProperty(this, methodName) var v = ScriptableObject.getProperty(this, methodName)
if (v is Function) { if (v is Function) {
val `fun` = v val function = v
val cx = Context.enter() val cx = Context.enter()
v = try { v = try {
`fun`.call(cx, `fun`.parentScope, this, args) function.call(cx, function.parentScope, this, args)
} finally { } finally {
Context.exit() Context.exit()
} }