pass session to onopen/onclose and ondestroy for consistency

This commit is contained in:
Mathias Buus 2022-03-10 23:38:18 +01:00
parent 576e08180f
commit b266f01bf2
1 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ class Session {
const remote = this._mux._remote[this._remoteId - 1] const remote = this._mux._remote[this._remoteId - 1]
this.opened = true this.opened = true
this._track(this.onopen()) this._track(this.onopen(this))
remote.session = this remote.session = this
if (remote.pending !== null) this._drain(remote) if (remote.pending !== null) this._drain(remote)
@ -123,7 +123,7 @@ class Session {
this._localId = 0 this._localId = 0
this._mux._gc(this._info) this._mux._gc(this._info)
this._track(this.onclose(isRemote)) this._track(this.onclose(isRemote, this))
if (this._active === 0) this._destroy() if (this._active === 0) this._destroy()
} }
@ -131,7 +131,7 @@ class Session {
_destroy () { _destroy () {
if (this.destroyed === true) return if (this.destroyed === true) return
this.destroyed = true this.destroyed = true
this._track(this.ondestroy()) this._track(this.ondestroy(this))
} }
_recv (type, state) { _recv (type, state) {