(type: string | symbol, ...args: unknown[])
| 13 | } |
| 14 | |
| 15 | override emit(type: string | symbol, ...args: unknown[]): boolean { |
| 16 | // Delegate to node for `error`, since it's not treated like a normal event |
| 17 | if (type === 'error') { |
| 18 | return super.emit(type, ...args) |
| 19 | } |
| 20 | |
| 21 | const listeners = this.rawListeners(type) |
| 22 | |
| 23 | if (listeners.length === 0) { |
| 24 | return false |
| 25 | } |
| 26 | |
| 27 | const ccEvent = args[0] instanceof Event ? args[0] : null |
| 28 | |
| 29 | for (const listener of listeners) { |
| 30 | listener.apply(this, args) |
| 31 | |
| 32 | if (ccEvent?.didStopImmediatePropagation()) { |
| 33 | break |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | return true |
| 38 | } |
| 39 | } |
| 40 |
no test coverage detected