I recently started getting an error in Chrome. [Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.
I tracked it down to the timeout function in the this.open method. The function in the setTimeout makes a direct call to websocket.close(). Line #227.
Using func.call() to help it define this seems to have cleared up the error. Can anyone see any unintended issues?
var localWs = ws;
var timeout = setTimeout(function() {
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'connection-timeout', self.url);
}
timedOut = true;
//localWs.close(); // this causes a strict mode violation
localWs.close.call(localWs); // better
timedOut = false;
}, self.timeoutInterval);
I recently started getting an error in Chrome.
[Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.
I tracked it down to the timeout function in the
this.open
method. The function in the setTimeout makes a direct call to websocket.close(). Line #227.Using
func.call()
to help it definethis
seems to have cleared up the error. Can anyone see any unintended issues?