// Bind the event to `context`, storing it with the event listing
if (!event_map._bound_events[event_name]) {
- event_map._bound_events[event_name] = fn.bind(context);
+ event_map._bound_events[event_name] = _.bind(fn, context);
}
// Add the listener to the IRC connection object
irc_connection.removeListener(namespace_prefix + event_name, event_map._bound_events[event_name]);
// Remove the bound function as no longer needed
- event_map._bound_events[event_name] = undefined;
+ delete event_map._bound_events[event_name];
}
});
+
+ delete event_map._bound_events;
};
\ No newline at end of file
motd_start: onMotdStart,
motd: onMotd,
motd_end: onMotdEnd,
- error: onError_,
+ error: onError,
password_mismatch: onPasswordMismatch,
channel_redirect: onChannelRedirect,
no_such_nick: onNoSuchNick,
});
};
-function onError_(event) {
+function onError(event) {
this.irc_connection.clientEvent('irc_error', {
error: 'error',
reason: event.reason