Skip to content

Commit

Permalink
Fix TypedEventEmitter::removeAllListeners(void) not working (#3561)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Jul 10, 2023
1 parent 4990bf5 commit b5b86bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/models/typed-event-emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ export class TypedEventEmitter<
* @returns a reference to the `EventEmitter`, so that calls can be chained.
*/
public removeAllListeners(event?: Events | EventEmitterEvents): this {
// EventEmitter::removeAllListeners uses `arguments.length` to determine undefined case
if (event === undefined) {
return super.removeAllListeners();
}
return super.removeAllListeners(event);
}

Expand Down

0 comments on commit b5b86bf

Please sign in to comment.