From 1378cef61f7089ef19c803328331cd2cf1a15fff Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 18 Feb 2013 15:55:55 +0000 Subject: [PATCH] Server: Removing plugin listeners from PluginInterface prototype --- server/plugininterface.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server/plugininterface.js b/server/plugininterface.js index 5566e54..a44fc7c 100644 --- a/server/plugininterface.js +++ b/server/plugininterface.js @@ -104,14 +104,11 @@ function EmitCall (event_name, event_data) { function PluginInterface () { + // Holder for all the bound listeners by this module + this._listeners = {}; } -// Holder for all the bound listeners by this module -PluginInterface.prototype._listeners = {}; - - - PluginInterface.prototype.on = function (event_name, fn, scope) { this._listeners[event_name] = this._listeners[event_name] || []; this._listeners[event_name].push(['on', fn, scope]); @@ -131,7 +128,7 @@ PluginInterface.prototype.off = function (event_name, fn, scope) { if (typeof event_name === 'undefined') { // Remove all listeners - this._listeners = []; + this._listeners = {}; } else if (typeof fn === 'undefined') { // Remove all of 1 event type -- 2.25.1