| Index: lib/filterNotifier.js |
| diff --git a/lib/filterNotifier.js b/lib/filterNotifier.js |
| index 624b2bf48d3c0fa5e8008a5690800b471fa846ab..b5c476e56896795687b3e166f1c9fc23f273aae8 100644 |
| --- a/lib/filterNotifier.js |
| +++ b/lib/filterNotifier.js |
| @@ -15,6 +15,8 @@ |
| * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| */ |
| +"use strict"; |
| + |
| /** |
| * @fileOverview This component manages listeners and calls them to distributes |
| * messages about filter changes. |
| @@ -26,6 +28,14 @@ let {desc} = require("coreUtils"); |
| const CATCH_ALL = "__all"; |
| /** |
| + * @callback FilterNotifierOnListener |
| + * @param {String} action |
| + * @param {Subscription|Filter} item |
| + * @param {any} newValue |
|
Sebastian Noack
2017/02/20 13:14:51
JSdoc interprets "any" as a class of the name "any
kzar
2017/02/21 06:13:59
Done.
|
| + * @param {any} oldValue |
| + */ |
| + |
| +/** |
| * This class allows registering and triggering listeners for filter events. |
| * @class |
| */ |
| @@ -34,8 +44,9 @@ exports.FilterNotifier = Object.create(new EventEmitter(), desc({ |
| * Adds a listener |
| * |
| * @deprecated use FilterNotifier.on(action, callback) |
| + * @param {FilterNotifierOnListener} listener |
| */ |
| - addListener: function(/**function(action, item, newValue, oldValue)*/ listener) |
| + addListener(listener) |
| { |
| let listeners = this._listeners[CATCH_ALL]; |
| if (!listeners || listeners.indexOf(listener) == -1) |
| @@ -46,8 +57,9 @@ exports.FilterNotifier = Object.create(new EventEmitter(), desc({ |
| * Removes a listener that was previosly added via addListener |
| * |
| * @deprecated use FilterNotifier.off(action, callback) |
| + * @param {FilterNotifierOnListener} listener |
| */ |
| - removeListener: function(/**function(action, item, newValue, oldValue)*/ listener) |
| + removeListener(listener) |
| { |
| this.off(CATCH_ALL, listener); |
| }, |
| @@ -62,9 +74,12 @@ exports.FilterNotifier = Object.create(new EventEmitter(), desc({ |
| * "filter.added", "filter.removed", "filter.moved", |
| * "filter.disabled", "filter.hitCount", "filter.lastHit") |
| * @param {Subscription|Filter} item item that the change applies to |
| + * @param {any} param1 |
| + * @param {any} param2 |
| + * @param {any} param3 |
| * @deprecated use FilterNotifier.emit(action) |
| */ |
| - triggerListeners: function(action, item, param1, param2, param3) |
| + triggerListeners(action, item, param1, param2, param3) |
| { |
| this.emit(action, item, param1, param2, param3); |
| this.emit(CATCH_ALL, action, item, param1, param2, param3); |