mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
ESlint manual fix
This commit is contained in:
@@ -196,7 +196,6 @@ Manager.prototype.maybeReconnectOnOpen = function () {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Sets the current transport `socket`.
|
||||
*
|
||||
@@ -299,7 +298,7 @@ Manager.prototype.onopen = function () {
|
||||
*/
|
||||
|
||||
Manager.prototype.onping = function () {
|
||||
this.lastPing = new Date;
|
||||
this.lastPing = new Date();
|
||||
this.emitAll('ping');
|
||||
};
|
||||
|
||||
@@ -310,7 +309,7 @@ Manager.prototype.onping = function () {
|
||||
*/
|
||||
|
||||
Manager.prototype.onpong = function () {
|
||||
this.emitAll('pong', new Date - this.lastPing);
|
||||
this.emitAll('pong', new Date() - this.lastPing);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -440,8 +439,11 @@ Manager.prototype.processPacketQueue = function () {
|
||||
Manager.prototype.cleanup = function () {
|
||||
debug('cleanup');
|
||||
|
||||
var sub;
|
||||
while (sub = this.subs.shift()) sub.destroy();
|
||||
var subsLength = this.subs.length;
|
||||
for (var i = 0; i < subsLength; i++) {
|
||||
var sub = this.subs.shift();
|
||||
sub.destroy();
|
||||
}
|
||||
|
||||
this.packetBuffer = [];
|
||||
this.encoding = false;
|
||||
|
||||
@@ -25,7 +25,7 @@ function url (uri, loc) {
|
||||
var obj = uri;
|
||||
|
||||
// default to window.location
|
||||
var loc = loc || global.location;
|
||||
loc = loc || global.location;
|
||||
if (null == uri) uri = loc.protocol + '//' + loc.host;
|
||||
|
||||
// relative path support
|
||||
@@ -56,8 +56,7 @@ function url (uri, loc) {
|
||||
if (!obj.port) {
|
||||
if (/^(http|ws)$/.test(obj.protocol)) {
|
||||
obj.port = '80';
|
||||
}
|
||||
else if (/^(http|ws)s$/.test(obj.protocol)) {
|
||||
} else if (/^(http|ws)s$/.test(obj.protocol)) {
|
||||
obj.port = '443';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user