ESlint manual fix

This commit is contained in:
Diga Widyaprana
2016-02-27 21:07:26 +08:00
parent d1cbc68ea7
commit c51a930a2c
6 changed files with 20 additions and 18 deletions

View File

@@ -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;

View File

@@ -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';
}
}