提交 077353b4 编写于 作者: C cdetrio 提交者: Felix Lange

console: fix return via callbacks (#2910)

Fixes #2872
上级 d6625ac3
......@@ -255,8 +255,8 @@ func (b *bridge) Send(call otto.FunctionCall) (response otto.Value) {
} else {
response, _ = resps.Get("0")
}
if fn := call.Argument(1).Object(); fn != nil && fn.Class() == "function" {
fn.Call("apply", response)
if fn := call.Argument(1); fn.Class() == "Function" {
fn.Call(otto.NullValue(), otto.NullValue(), response)
return otto.UndefinedValue()
}
return response
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册