diff --git a/lib/connection/base.js b/lib/connection/base.js index 510d695..076ba9b 100644 --- a/lib/connection/base.js +++ b/lib/connection/base.js @@ -1,7 +1,7 @@ -var chooseProtocol = require('../protocol').chooseProtocol +let chooseProtocol = require('../protocol').chooseProtocol , EventEmitter = require('events').EventEmitter; -var BaseConnection = module.exports = function(opts) { +let BaseConnection = module.exports = function(opts) { this.opts = Object.assign({ host : '127.0.0.1', scheme: this.getScheme(), @@ -86,7 +86,7 @@ BaseConnection.prototype.handleClose = function(code, reason) { } BaseConnection.prototype.startReconnection = function() { - var connection = this; + let connection = this; if(!this.reconnectionTimer){ (this.reconnectionTimer = setInterval(function() { connection.reconnect() }, 500)); } @@ -124,9 +124,9 @@ BaseConnection.prototype.reconnect = function() { } BaseConnection.prototype.handleData = function(data) { - var message = JSON.parse(data); + let message = JSON.parse(data); - var messageEvent; + let messageEvent; if (this.protocol === undefined) { messageEvent = this.protocol = chooseProtocol(message); this.protocolVersionVerified = true; @@ -156,4 +156,4 @@ BaseConnection.prototype.reportFocus = function(state) { } } -Object.assign(BaseConnection.prototype, EventEmitter.prototype); \ No newline at end of file +Object.assign(BaseConnection.prototype, EventEmitter.prototype);