Browse files

variables which are no constructor shouldn't start with a uppercase l…

…etter
  • Loading branch information...
1 parent dc593e9 commit 9a306fddab54ce45bf896b7374641f6e13a85dce @christiaan christiaan committed May 28, 2010
Showing with 14 additions and 15 deletions.
  1. +2 −2 lib/socket.io/client.js
  2. +11 −12 lib/socket.io/listener.js
  3. +1 −1 lib/socket.io/util/options.js
View
4 lib/socket.io/client.js
@@ -1,8 +1,8 @@
-var Options = require('./util/options').Options;
+var options = require('./util/options').options;
this.Client = Class({
- include: [Options],
+ include: [options],
options: {
closeTimeout: 0
View
23 lib/socket.io/listener.js
@@ -1,13 +1,12 @@
var url = require('url'),
- sys = require('sys'),
- Options = require('./util/options').Options,
- Client = require('./client').Client,
+ sys = require('sys'),
+ options = require('./util/options').options,
+ Client = require('./client').Client,
+ transports = {};
-Transports = {};
-
-Listener = this.Listener = Class({
+var Listener = this.Listener = Class({
- include: [process.EventEmitter.prototype, Options],
+ include: [process.EventEmitter.prototype, options],
options: {
origins: '*:*',
@@ -44,9 +43,9 @@ Listener = this.Listener = Class({
});
this.options.transports.forEach(function(t){
- if (!(t in Transports)){
- Transports[t] = require('./transports/' + t)[t];
- if (Transports[t].init) Transports[t].init(this);
+ if (!(t in transports)){
+ transports[t] = require('./transports/' + t)[t];
+ if (transports[t].init) transports[t].init(this);
}
}, this);
@@ -110,12 +109,12 @@ Listener = this.Listener = Class({
// new connections (no session id)
_onConnection: function(transport, req, res, httpUpgrade){
- if (this.options.transports.indexOf(transport) === -1 || (httpUpgrade && !Transports[transport].httpUpgrade)){
+ if (this.options.transports.indexOf(transport) === -1 || (httpUpgrade && !transports[transport].httpUpgrade)){
httpUpgrade ? res.destroy() : req.connection.destroy();
return sys.log('Illegal transport "'+ transport +'"');
}
sys.log('Initializing client with transport "'+ transport +'"');
- new Transports[transport](this, req, res, this.options.transportOptions[transport]);
+ new transports[transport](this, req, res, this.options.transportOptions[transport]);
}
});
View
2 lib/socket.io/util/options.js
@@ -2,7 +2,7 @@
// Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net/>
var object = require('./object'), sys = require('sys');
-this.Options = {
+exports.options = {
options: {},

0 comments on commit 9a306fd

Please sign in to comment.