instance.emit = function () { var args = Array.prototype.slice.apply(arguments); if (args[0] === 'starting') { server.stop && server.stop(); } else if (args[0] === 'run.complete') { server.start && server.start(); } try { emit.apply(this, arguments); } catch (e) { emit.call(this, 'log', e.message, args[1].location); } this.constructor.prototype.emit.apply(this, args.slice()); };
Gamepad.context.on = function () { Gamepad.emit.apply(Gamepad, arguments); };
bot.emit = function(){ var args = Array.prototype.slice.call(arguments, 0); ev.emit.apply(ev, [].concat(['irc.' + args[0]], args.slice(1))); oldEmitter.apply(bot, args); };
server.emit = function () { emit.apply(server, arguments); app.emit.apply(app, arguments); };