functions for setTimeout should get the context bound and not applied (#1673)

This commit is contained in:
SpaceEEC
2017-07-10 03:34:54 +02:00
committed by Crawl
parent a7e5e53e5d
commit 618fa2b104

View File

@@ -444,7 +444,7 @@ class WebSocketConnection extends EventEmitter {
* @returns {void}
*/
identify(after) {
if (after) return this.client.setTimeout(this.identify.apply(this), after);
if (after) return this.client.setTimeout(this.identify.bind(this), after);
return this.sessionID ? this.identifyResume() : this.identifyNew();
}