Server: Moving events from the module prototype
authorDarren <darren@darrenwhitlen.com>
Thu, 18 Jul 2013 17:32:11 +0000 (18:32 +0100)
committerDarren <darren@darrenwhitlen.com>
Thu, 18 Jul 2013 17:32:11 +0000 (18:32 +0100)
server/modules.js

index cfba650f2ad412ca1799e0be3b187d162792d43e..08f17f5a5f76891376c157960fbca9fd5cbcddd4 100644 (file)
@@ -35,7 +35,7 @@ function registerPublisher (obj) {
  */
 
 // Hold the loaded modules
-var registered_modules = {};
+var registered_modules = [];
 
 function loadModule (module_file) {
     var module,
@@ -80,13 +80,13 @@ function unloadModule (module) {
  * To be created by modules to bind to server events
  */
 function Module (module_name) {
-    registered_modules[module_name] = this;
+    registered_modules.push(this);
     this.module_name = module_name;
-}
 
+    // Holder for all the bound events by this module
+    this._events = {};
+}
 
-// Holder for all the bound events by this module
-Module.prototype._events = {};
 
 
 // Keep track of this modules events and bind