Permalink
Browse files

Make http.ServerResponse and http.ServerRequest event emitters

[changelog]
  • Loading branch information...
1 parent 803eaa2 commit c3239a4c09f0e97b2a3e3348ce8a9c5c8c72cdd6 @vojtajina committed Dec 10, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/http.js
View
@@ -1,3 +1,7 @@
+var util = require('util');
+var EventEmitter = require('events').EventEmitter;
+
+
var ServerResponse = function() {
var headSent = false;
var bodySent = false;
@@ -38,10 +42,14 @@ var ServerResponse = function() {
};
};
+util.inherits(ServerResponse, EventEmitter);
+
var ServerRequest = function(url) {
this.url = url;
};
+util.inherits(ServerRequest, EventEmitter);
+
// PUBLIC stuff
exports.ServerResponse = ServerResponse;

0 comments on commit c3239a4

Please sign in to comment.