Permalink
Browse files

cleanup

  • Loading branch information...
1 parent 71a905d commit 71a436396e9ba3b071ff6f7170da8d0a90bf5a19 @fent committed Aug 19, 2012
Showing with 16 additions and 10 deletions.
  1. +8 −8 lib/index.js
  2. +8 −2 lib/store.js
View
@@ -9,9 +9,9 @@
* Module dependencies.
*/
-var Store = require('./store')
- , assert = require('assert')
- , hub = require('clusterhub')
+var inherits = require('util').inherits;
+var Store = require('./store');
+var hub = require('clusterhub');
/**
* Exports the constructor.
@@ -30,13 +30,13 @@ function Hub (id) {
this.hub = hub.createHub(id || 'socket.io-clusterhub');
Store.call(this, {});
this.setMaxListeners(0);
-};
+}
/**
* Inherits from Store.
*/
-Hub.prototype.__proto__ = Store.prototype;
+inherits(Hub, Store);
/**
* Publishes a message.
@@ -92,13 +92,13 @@ Hub.prototype.destroy = function () {
function Client (store, id) {
Store.Client.call(this, store.hub, id);
-};
+}
/**
* Inherits from Store.Client
*/
-Client.prototype.__proto__ = Store.Client;
+ inherits(Client, Store);
/**
* Hub hash get
@@ -164,7 +164,7 @@ Client.prototype.has = function (key, fn) {
*/
Client.prototype.destroy = function (expiration) {
- if ('number' != typeof expiration) {
+ if ('number' !== typeof expiration) {
this.store.del(this.id);
} else {
this.store.expire(this.id, expiration);
View
@@ -6,6 +6,12 @@
*/
/**
+ * Module dependencies.
+ */
+
+var inherits = require('util').inherits;
+
+/**
* Expose the constructor.
*/
@@ -26,13 +32,13 @@ var EventEmitter = process.EventEmitter;
function Store (options) {
this.options = options;
this.clients = {};
-};
+}
/**
* Inherit from EventEmitter.
*/
-Store.prototype.__proto__ = EventEmitter.prototype;
+inherits(Store, EventEmitter);
/**
* Initializes a client store

0 comments on commit 71a4363

Please sign in to comment.