Skip to content

Commit

Permalink
Add a comment explaining EventEmitter#on removing aEL
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Jan 23, 2015
1 parent dd4d1d9 commit 5c36d27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/event-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ vjs.EventEmitter.prototype.allowedEvents_ = {
};

vjs.EventEmitter.prototype.on = function(type, fn) {
// Remove the addEventListener alias before calling vjs.on
// so we don't get into an infinite type loop
var ael = this.addEventListener;
this.addEventListener = Function.prototype;
vjs.on(this, type, fn);
Expand Down

0 comments on commit 5c36d27

Please sign in to comment.