Correct null assigner instead of or assignment
This commit is contained in:
parent
64c345564a
commit
76dbe00a7f
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user