From b266f01bf248216af82e8811f2a78bbf861acb8d Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Thu, 10 Mar 2022 23:38:18 +0100 Subject: [PATCH] pass session to onopen/onclose and ondestroy for consistency --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 55026d0..f55e2a9 100644 --- a/index.js +++ b/index.js @@ -81,7 +81,7 @@ class Session { const remote = this._mux._remote[this._remoteId - 1] this.opened = true - this._track(this.onopen()) + this._track(this.onopen(this)) remote.session = this if (remote.pending !== null) this._drain(remote) @@ -123,7 +123,7 @@ class Session { this._localId = 0 this._mux._gc(this._info) - this._track(this.onclose(isRemote)) + this._track(this.onclose(isRemote, this)) if (this._active === 0) this._destroy() } @@ -131,7 +131,7 @@ class Session { _destroy () { if (this.destroyed === true) return this.destroyed = true - this._track(this.ondestroy()) + this._track(this.ondestroy(this)) } _recv (type, state) {