Skip to content
Browse files

Improved EventEmitter

  • Loading branch information...
1 parent 466600c commit 62279413ba952f45988854ec02a43d4cb93bc7e0 @partheseas committed
Showing with 5 additions and 14 deletions.
  1. +5 −14 trailer.js
View
19 trailer.js
@@ -27,20 +27,11 @@ trailer.http = http
// 302 should be Found.
http.STATUS_CODES[ 302 ] = "Found"
-trailer.EventEmitter = function () {
- var mark, prop;
-
- mark = new events.EventEmitter()
-
- for ( prop in mark ) ( function ( method, name ) {
- if ( Function.is( events.EventEmitter.prototype[ name ] ) ) {
- mark[ name ] = function () {
- return method.apply( mark, arguments ) || trailer[ name ].apply( trailer, arguments )
- }
- }
- } )( mark[ prop ], prop )
-
- return mark
+trailer.EventEmitter = events.EventEmitter
+events.emit = events.EventEmitter.prototype.emit
+
+trailer.EventEmitter.prototype.emit = function () {
+ return events.emit.apply( this, arguments ) || events.emit.apply( trailer, arguments )
}
trailer.MimeDictionary = function ( map ) {

0 comments on commit 6227941

Please sign in to comment.
Something went wrong with that request. Please try again.