Permalink
Browse files

Go Lint Yourself.

  • Loading branch information...
1 parent e393073 commit 9ce46989cb6546909889e8afa88d8f0b7c4006de @miksago miksago committed Dec 2, 2010
Showing with 346 additions and 373 deletions.
  1. +8 −12 lib/_events.js
  2. +1 −1 lib/_util.js
  3. +4 −5 lib/lang/mixin.js
  4. +174 −187 lib/ws/connection.js
  5. +56 −50 lib/ws/manager.js
  6. +54 −76 lib/ws/parser.js
  7. +49 −42 lib/ws/server.js
View
@@ -1,30 +1,26 @@
-var util = require("./_util")
- , events = require("events")
+var util = require('./_util'),
+ events = require('events');
-EventEmitter = exports.EventEmitter = function(){
+EventEmitter = exports.EventEmitter = function() {
events.EventEmitter.call(this);
};
util.inherits(EventEmitter, events.EventEmitter);
EventEmitter.prototype.emit = function(type) {
- if (type !== "newListener"
- && (!this._events || !this._events[type])
- && this._bubbleTarget && this._bubbleTarget[type]
- ) {
- // util.error("\033[31mEvent: "+type+", source: "+this.constructor.name+", target: "+this._bubbleTarget[type].constructor.name+"\033[39m");
+ if (type !== 'newListener' && (!this._events || !this._events[type]) &&
+ this._bubbleTarget && this._bubbleTarget[type]) {
this._bubbleTarget[type].emit.apply(this._bubbleTarget[type], arguments);
} else {
- // util.error("\033[31mEvent: "+type+", source: "+this.constructor.name+"\033[39m");
events.EventEmitter.prototype.emit.apply(this, arguments);
}
};
-EventEmitter.prototype.bubbleEvent = function(type, target){
- if(!this._bubbleTarget) this._bubbleTarget = {};
+EventEmitter.prototype.bubbleEvent = function(type, target) {
+ if (!this._bubbleTarget) this._bubbleTarget = {};
this._bubbleTarget[type] = target;
};
EventEmitter.prototype.removeBubbleEvent = function(type) {
delete this._bubbleTarget[type];
-};
+};
View
@@ -1 +1 @@
-module.exports = require(process.binding("natives").util ? "util" : "sys")
+module.exports = require(process.binding('natives').util ? 'util' : 'sys');
View
@@ -1,13 +1,12 @@
-
module.exports = function Mixin(target, source) {
if (source) {
- for(var key, keys = Object.keys(source), l = keys.length; l--; ) {
+ for (var key, keys = Object.keys(source), l = keys.length; l--; ) {
key = keys[l];
-
- if(source.hasOwnProperty(key)){
+
+ if (source.hasOwnProperty(key)) {
target[key] = source[key];
}
}
}
return target;
-};
+};
Oops, something went wrong.

0 comments on commit 9ce4698

Please sign in to comment.