From e5f4f59477d2b033bcfbaa2c509706dfa117142e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 2 Mar 2023 05:30:14 -0500 Subject: [PATCH] *Don't bind this, but inject ourselves as the first argument --- src/peer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/peer.ts b/src/peer.ts index 5039ff7..d155c6d 100644 --- a/src/peer.ts +++ b/src/peer.ts @@ -57,10 +57,10 @@ export default class Peer { this._proxy = proxy; this._peer = peer; this._muxer = muxer; - this._onopen = onopen?.bind(this); - this._onreceive = onreceive?.bind(this); - this._onsend = onsend?.bind(this); - this._onclose = onclose?.bind(this); + this._onopen = onopen?.bind(undefined, this); + this._onreceive = onreceive?.bind(undefined, this); + this._onsend = onsend?.bind(undefined, this); + this._onclose = onclose?.bind(undefined, this); this._emulateWebsocket = emulateWebsocket; }