Delivery iterates a snapshot of the listener set — the same contract
VS Code's own EventEmitter has, and the one that is easy to get wrong: a
listener disposing itself, or another, part-way through a firing must not
cause anyone else to be skipped.
Listener failures are not isolated: fire propagates the exception and does
not call later listeners in that delivery. Callers that need best-effort
observers must isolate them before registration.
Minimal event emitter for the vscode-free core.
Delivery iterates a snapshot of the listener set — the same contract VS Code's own
EventEmitterhas, and the one that is easy to get wrong: a listener disposing itself, or another, part-way through a firing must not cause anyone else to be skipped.Listener failures are not isolated:
firepropagates the exception and does not call later listeners in that delivery. Callers that need best-effort observers must isolate them before registration.