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());
        };
Beispiel #2
0
Gamepad.context.on = function () {
  Gamepad.emit.apply(Gamepad, arguments);
};
Beispiel #3
0
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);
};
Beispiel #4
0
server.emit = function () {
  emit.apply(server, arguments);
  app.emit.apply(app, arguments);
};