Skip to content

Commit

Permalink
src/EventEmitter.js: correctly inherit from Node's EventEmitter
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-onsip committed Dec 15, 2014
1 parent 8fd46ad commit 1f9485e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/EventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ var NodeEventEmitter = require('events').EventEmitter;

module.exports = function (console) {

function EventEmitter () {}
function EventEmitter () {
NodeEventEmitter.call(this);
}

EventEmitter.prototype = Object.create(NodeEventEmitter.prototype);
EventEmitter.prototype = Object.create(NodeEventEmitter.prototype, {
constructor: {
value: EventEmitter,
enumerable: false,
writable: true,
configurable: true
}
});

EventEmitter.prototype.off = function off (eventName, listener) {
var warning = '';
Expand Down

0 comments on commit 1f9485e

Please sign in to comment.