var EventEmitter = (function() {
    function EventEmitter() {
        this.events = {};
        this.on = this.bind;
        this.emit = this.trigger;
    }

    EventEmitter.prototype.bind = function(name, handler, context) {
        var event,
            events;
        this.events[name] = this.events[name] || [];
        events = this.events[name];
        event = {
            handler: handler,
            context: context
        };
        events.push(event);
        return this;
    };



    EventEmitter.prototype.trigger = function(/*name, param1, param2...*/) {
        var name = arguments[0],
            events = this.events[name] || [],
            params = Array.prototype.slice.call(arguments, 1);
        for(var i = 0, iLen = events.length; i < iLen; i++) {
            events[i].handler.apply(events[i].context || this, params);
        }
        return this;
    };

    EventEmitter.prototype.removeEvent = function(name, handler) {
        var events = this.events[name] || [];
        if(arguments.length === 0) {
            this.removeAllEvents();
            return this;
        }
        if(arguments.length === 1) {
            this.removeAllEvents(name);
            return this;
        }
        for(var i = 0, iLen = events.length; i < iLen; i++) {
            if(events[i].handler == handler) {
                events[i] = null;
            }
        }
        return this;
    };

    EventEmitter.prototype.removeAllEvents = function(name) {
        if(name) {
            this.events[name] = [];
        } else {
            this.events = {};
        }
        return this;
    };

    return EventEmitter;
})();

@@ -494,17 +494,290 @@
     %7D;%0A%0A
+    EventEmitter.prototype.once = function(name, handler, context) %7B%0A        var self = this;%0A        function temp() %7B%0A            self.removeEvent(name, temp);%0A            handler.call(this);%0A        %7D%0A        handler._remove = temp;%0A        this.bind(name, temp);%0A    %7D;
 %0A
-
 %0A    Eve
@@ -1332,25 +1332,19 @@
 his.
-removeAllEvents()
+events = %7B%7D
 ;%0A  
@@ -1409,24 +1409,49 @@
 th === 1) %7B%0A
+            events = %5B%5D;%0A
             
@@ -1622,180 +1622,56 @@
 dler
-) %7B%0A                events%5Bi%5D = null;%0A            %7D%0A        %7D%0A        return this;%0A    %7D;%0A%0A    EventEmitter.prototype.removeAllEvents = function(name) %7B%0A        if(name) %7B%0A
+ %7C%7C events%5Bi%5D.handler._remove == handler) %7B%0A    
     
@@ -1682,78 +1682,41 @@
     
-this.
 events
-%5Bname%5D = %5B%5D;%0A        %7D else %7B%0A            this.events = %7B%7D;
+.splice(i, 1)%0A            %7D
 %0A   

add EventEmitter.once