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

Side by Side Diff: lib/events.js

Issue 29807560: Issue 6745 - Prefer strict equality operator (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created June 14, 2018, 4:11 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/elemHide.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 * 48 *
49 * @param {string} name 49 * @param {string} name
50 * @param {function} listener 50 * @param {function} listener
51 */ 51 */
52 off(name, listener) 52 off(name, listener)
53 { 53 {
54 let listeners = this._listeners.get(name); 54 let listeners = this._listeners.get(name);
55 if (listeners) 55 if (listeners)
56 { 56 {
57 let idx = listeners.indexOf(listener); 57 let idx = listeners.indexOf(listener);
58 if (idx != -1) 58 if (idx !== -1)
59 listeners.splice(idx, 1); 59 listeners.splice(idx, 1);
60 } 60 }
61 }, 61 },
62 62
63 /** 63 /**
64 * Adds a one time listener and returns a promise that 64 * Adds a one time listener and returns a promise that
65 * is resolved the next time the specified event is emitted. 65 * is resolved the next time the specified event is emitted.
66 * @param {string} name 66 * @param {string} name
67 * @return {Promise} 67 * @return {Promise}
68 */ 68 */
(...skipping 29 matching lines...) Expand all
98 * @param {string} name 98 * @param {string} name
99 * @param {...*} [arg] 99 * @param {...*} [arg]
100 */ 100 */
101 emit(name, ...args) 101 emit(name, ...args)
102 { 102 {
103 let listeners = this.listeners(name); 103 let listeners = this.listeners(name);
104 for (let listener of listeners) 104 for (let listener of listeners)
105 listener(...args); 105 listener(...args);
106 } 106 }
107 }; 107 };
OLDNEW
« no previous file with comments | « lib/elemHide.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld