Clear all listeners for the given event names by setting their array length to 0, WITHOUT deleting the keys. This keeps the eventListeners object in V8's fast-properties mode and avoids re-allocating the arrays on the next on() call. Use this for objects with a known fixed set of event names (e.g. CoreAnimation, CoreAnimationController).
Only writes arr.length = 0 when the array is non-empty -- skips the write (and the write barrier on old-gen objects) when already empty, which is the common case after unregisterAnimation() has removed all listeners.
Optionaldata: anyEmit to all listeners, isolating each one from the others.
Optionaldata: anyOptionalonError: LoopErrorHandlerUnlike emit, a throwing listener neither aborts the remaining
listeners nor propagates to the caller (e.g. the rAF loop). Each error is
routed to onError (handleLoopError) or console.error and iteration
continues. Internal renderer code should keep using emit (fail loudly);
app-facing boundaries should use this.
Kept as a separate method so the hot emit path — and more importantly
its callers in the frame loop — stay try-free for older JITs.
Check whether this emitter has any listeners registered.
Optionalevent: string
Optional event name. When provided, checks only that event. When omitted, checks all events.
true if at least one listener is registered.
Optionallistener: EventListener
EventEmitter base class
Remarks
The
eventListenersmap is allocated lazily on the firston()call. Many objects (e.g. CoreNodes that never have listeners attached) avoid the cost of allocating an empty{}at construction time.