diff --git a/src/haxe/net/WebSocket.hx b/src/haxe/net/WebSocket.hx index 1572e82..139f752 100644 --- a/src/haxe/net/WebSocket.hx +++ b/src/haxe/net/WebSocket.hx @@ -75,6 +75,6 @@ class WebSocket { public dynamic function onmessageBytes(message:Bytes):Void { } - public dynamic function onclose():Void { + public dynamic function onclose(?e:Dynamic):Void { } } diff --git a/src/haxe/net/impl/WebSocketJs.hx b/src/haxe/net/impl/WebSocketJs.hx index d731e17..8dd1d11 100644 --- a/src/haxe/net/impl/WebSocketJs.hx +++ b/src/haxe/net/impl/WebSocketJs.hx @@ -32,7 +32,7 @@ class WebSocketJs extends WebSocket { this.onopen(); }; impl.onclose = function(e:js.html.Event) { - this.onclose(); + this.onclose(e); }; impl.onerror = function(e:js.html.Event) { this.onerror('error');