From b8ff5d1bdedcb1f3d3d705fbeb39b9c05dd04fe1 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 15 Feb 2019 10:22:27 +0100 Subject: [PATCH] Use arrow function to avoid bind --- core/rfb.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/rfb.js b/core/rfb.js index 42c4ad30..39683cbd 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -182,7 +182,9 @@ export default class RFB extends EventTargetMixin { this._mouse.onmousemove = this._handleMouseMove.bind(this); this._sock = new Websock(); - this._sock.on('message', this._handle_message.bind(this)); + this._sock.on('message', () => { + this._handle_message(); + }); this._sock.on('open', () => { if ((this._rfb_connection_state === 'connecting') && (this._rfb_init_state === '')) {