Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventEmitter bug fix #336

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/events/EventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = EventEmitter;
* });
*/
function EventEmitter() {
this.tmpArray = [];
}

EventEmitter.prototype = {
Expand Down Expand Up @@ -116,15 +115,14 @@ EventEmitter.prototype = {
event.target = this;

// Need to copy the listener array, in case some listener was added/removed inside a listener
var tmpArray = this.tmpArray;
var tmpArray = [];
for (var i = 0, l = listenerArray.length; i < l; i++) {
tmpArray[i] = listenerArray[i];
}
for (var i = 0, l = tmpArray.length; i < l; i++) {
var listener = tmpArray[ i ];
listener.call( listener.context, event );
}
tmpArray.length = 0;
}
return this;
}
Expand Down