Correct null assigner instead of or assignment

This commit is contained in:
Benjamin Claassen 2025-01-17 00:10:56 +01:00
parent 64c345564a
commit 76dbe00a7f
No known key found for this signature in database
GPG Key ID: C5F495EAE56673BF

View File

@ -13,7 +13,7 @@ class EventHandler {
}
on(event, listener) {
this.events[event] ||= { name: name, listeners: [], callCount: 0 }
this.events[event] ??= { name: name, listeners: [], callCount: 0 }
this.events[event].listeners.push(listener)
}