Permalink
Browse files

'Fix warnings in c9'

  • Loading branch information...
1 parent 5b644b7 commit cbd6220cf049bb52ebfca2529b50af3bbeaf86d7 @tomyan committed Mar 4, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/circus.js
View
@@ -8,7 +8,7 @@ var Channel = function (name, connection) {
this.connection = connection;
this.connection.sendJoin(name);
this.onMessage = on(this);
- this.joined = new promise.Promise;
+ this.joined = new promise.Promise();
};
Channel.prototype.sendMessage = function (message) {
@@ -56,7 +56,7 @@ var Connection = function (nick, hostname, options) {
this._socket.addListener('connect', bind(this._onConnect, this));
this._socket.addListener('data', bind(this._onData, this));
this.onMessage = on(this);
- this.connected = new promise.Promise;
+ this.connected = new promise.Promise();
this._buffer = '';
};
@@ -130,7 +130,8 @@ Connection.prototype._handlePrivMsg = function (message) {
this.onMessage._fire(message.trailing, agent);
}
else {
- var channel = this._channels[message.middle[0]];
+ var channelName = message.middle[0],
+ channel = this._channels[channelName];
if (! channel) {
throw new Error('received message on unjoined channel: ' + channelName + '(from ' + agent + ')');
}
@@ -152,7 +153,7 @@ Client.prototype.connect = function (nick, hostname, options) {
var connection = new Connection(nick, hostname, options);
this.connections.push(connection);
return connection.connected;
-}
+};
var tokens = {};
tokens.name = '[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?';
@@ -187,7 +188,7 @@ Connection.prototype.handleMessage = function (received) {
console.log('< ' + received.substr(0, received.length - 2));
}
var match = received.match(matcher);
- if (match != null) {
+ if (match !== null) {
var message = {
hostname: match[1] || match[4],
nick: match[2],
@@ -204,7 +205,7 @@ Connection.prototype.handleMessage = function (received) {
this._handlePing(message);
break;
case 'JOIN':
- this._handleJoin(message)
+ this._handleJoin(message);
break;
case 'PRIVMSG':
this._handlePrivMsg(message);

0 comments on commit cbd6220

Please sign in to comment.