Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/filterNotifier.js

Issue 5743624616673280: Issue 261 - FilterNotifier doesn`t support listeners removing themselves when triggered (Closed)
Patch Set: Created April 4, 2014, 12:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterNotifier.js
===================================================================
--- a/lib/filterNotifier.js
+++ b/lib/filterNotifier.js
@@ -61,12 +61,13 @@ let FilterNotifier = exports.FilterNotif
* "subscription.lastDownload", "subscription.downloadStatus",
* "subscription.homepage", "subscription.updated",
* "filter.added", "filter.removed", "filter.moved",
* "filter.disabled", "filter.hitCount", "filter.lastHit")
* @param {Subscription|Filter} item item that the change applies to
*/
triggerListeners: function(action, item, param1, param2, param3)
{
- for each (let listener in listeners)
+ let list = listeners.slice();
+ for each (let listener in list)
listener(action, item, param1, param2, param3);
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld