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 4e5556ba09
commit c0e9ce2a1d

View File

@@ -445,7 +445,7 @@ class WebSocketConnection extends EventEmitter {
* @returns {void} * @returns {void}
*/ */
identify(after) { 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(); return this.sessionID ? this.identifyResume() : this.identifyNew();
} }