.emit copies the listeners array before executing them, to guard against listeners that will mutate it while iterating