Commit b43c9838 authored by Joel Martin's avatar Joel Martin

web-socket-js: Add function invocation fix.

Related to this issue:
https://github.com/gimite/web-socket-js/issues/#issue/50

This prevents the "Uncaught exception: TypeError:
'this.__handleEvents' is not a function" everytime the timer fires.

Yay, one of Javascript's worst behaviors; the way it sets "this".
parent 9a23006e
......@@ -165,8 +165,9 @@
if (this.__timer) clearInterval(this.__timer);
if (window.opera) {
// Workaround for weird behavior of Opera which sometimes drops events.
var that = this;
this.__timer = setInterval(function () {
this.__handleEvents();
that.__handleEvents();
}, 500);
}
if (this.onopen) this.onopen();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment