| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 if (listeners[i].listener === listener && listeners[i].thisObject === this
Object) | 62 if (listeners[i].listener === listener && listeners[i].thisObject === this
Object) |
| 63 listeners.splice(i--, 1); | 63 listeners.splice(i--, 1); |
| 64 } | 64 } |
| 65 | 65 |
| 66 if (!listeners.length) | 66 if (!listeners.length) |
| 67 this._listeners.delete(eventType); | 67 this._listeners.delete(eventType); |
| 68 } | 68 } |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * @override | 71 * @override |
| 72 */ | |
| 73 removeAllListeners() { | |
| 74 delete this._listeners; | |
| 75 } | |
| 76 | |
| 77 /** | |
| 78 * @override | |
| 79 * @param {symbol} eventType | 72 * @param {symbol} eventType |
| 80 * @return {boolean} | 73 * @return {boolean} |
| 81 */ | 74 */ |
| 82 hasEventListeners(eventType) { | 75 hasEventListeners(eventType) { |
| 83 return this._listeners && this._listeners.has(eventType); | 76 return this._listeners && this._listeners.has(eventType); |
| 84 } | 77 } |
| 85 | 78 |
| 86 /** | 79 /** |
| 87 * @override | 80 * @override |
| 88 * @param {symbol} eventType | 81 * @param {symbol} eventType |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 */ | 130 */ |
| 138 addEventListener(eventType, listener, thisObject) {}, | 131 addEventListener(eventType, listener, thisObject) {}, |
| 139 | 132 |
| 140 /** | 133 /** |
| 141 * @param {symbol} eventType | 134 * @param {symbol} eventType |
| 142 * @param {function(!Common.Event)} listener | 135 * @param {function(!Common.Event)} listener |
| 143 * @param {!Object=} thisObject | 136 * @param {!Object=} thisObject |
| 144 */ | 137 */ |
| 145 removeEventListener(eventType, listener, thisObject) {}, | 138 removeEventListener(eventType, listener, thisObject) {}, |
| 146 | 139 |
| 147 removeAllListeners() {}, | |
| 148 | |
| 149 /** | 140 /** |
| 150 * @param {symbol} eventType | 141 * @param {symbol} eventType |
| 151 * @return {boolean} | 142 * @return {boolean} |
| 152 */ | 143 */ |
| 153 hasEventListeners(eventType) {}, | 144 hasEventListeners(eventType) {}, |
| 154 | 145 |
| 155 /** | 146 /** |
| 156 * @param {symbol} eventType | 147 * @param {symbol} eventType |
| 157 * @param {*=} eventData | 148 * @param {*=} eventData |
| 158 */ | 149 */ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 169 * @param {(!Object|undefined)} receiver | 160 * @param {(!Object|undefined)} receiver |
| 170 * @param {function(?):?} method | 161 * @param {function(?):?} method |
| 171 */ | 162 */ |
| 172 constructor(eventTarget, eventType, receiver, method) { | 163 constructor(eventTarget, eventType, receiver, method) { |
| 173 this.eventTarget = eventTarget; | 164 this.eventTarget = eventTarget; |
| 174 this.eventType = eventType; | 165 this.eventType = eventType; |
| 175 this.receiver = receiver; | 166 this.receiver = receiver; |
| 176 this.method = method; | 167 this.method = method; |
| 177 } | 168 } |
| 178 }; | 169 }; |
| OLD | NEW |