Websocket jsb的问题

Websocket的回调方法中返回的参数event, 在web端可以获取到event.target, 在jsb端就拿不到

this.ws.onclose = (function (evt) {
    if (this.ws !== evt.target) {
        evt.target.close();
        evt.target = null;
        return;
    }
    cc.log('close:' + evt.code);
    if (closeHandler) {
        closeHandler(evt.code);
    }
    this.ws.close();
    this.ws = null;
}).bind(this);

web上这段代码是没有问题的,native中src/project.dev.js:252:TypeError: evt.target is undefined

            jsval dataVal[2];
            dataVal[0] = OBJECT_TO_JSVAL(jsobj);
            js_type_class_t *typeClass = js_get_type_from_native<WebSocket>(ws);
            dataVal[1] = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(cx, ws, typeClass, "WebSocket"));
            
            ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate.ref()), "onclose", 2, dataVal);

太坑了,本来想无视这个问题的。最后还是得自己报上来

@panda

这个问题1.6了还没解决。。。。。。

看来只能期待1.7中解决了。

https://github.com/cocos-creator/cocos2d-x-lite/issues/839

在1.7中修复:
https://github.com/cocos-creator/cocos2d-x-lite/pull/849