Now I'm trying to implement Unity Webgl with jslib. I'm so confused about how to call method in another method's function. I want to call method Recv when message was coming (ws.onmessage). But, it show "TypeError: this.Recv is undefined". Could you please help me figure out this source? 
Thank you !!!!!
Here's my source code
var ws = null;
var init_url = "";
var received_msg = "";
var error_msg = "";
var WebsocketLib = {
Hello: function(){
    window.alert("Hello,world!");
},
InitSocket: function(url){
    init_url = Pointer_stringify(url);
    console.log("InitWebSocket: "+init_url);
    ws = new WebSocket(init_url);
    ws.onopen = function(evt){ 
            console.log("Connect");
            isConnected = false;
            ws.send("hello");
        }; 
    ws.onclose = function(evt) { 
            console.log("Close");
            isConnected = false;
        }; 
    ws.onmessage = function(evt) {
            received_msg = evt.data;
            console.log("[recv] "+received_msg);
            this.Recv.call(this);
        }; 
    ws.onerror = function(evt) {
            error_msg = evt.data;
            console.log("[error] "+error_msg);
            this.Error.call(this);
        };
},
Recv: function(){
    console.log("[recv] "+received_msg);
    var buffer = _malloc(received_msg.length + 1);
    writeStringToMemory(returnStr, buffer);
    return buffer;
},
Error: function(){
    console.log("[error] "+error_msg);
    var buffer = _malloc(error_msg.length + 1);
    writeStringToMemory(error_msg, buffer);
    return buffer;
}
}
 
     
    