events: keep event in dispatching state across all listeners #67765
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.36) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 185 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.313
Real PR Conversation Timeline
1 comments
"Review active on #67765"
general
weight: 0.35
gurgunday
EventTarget.prototype[kHybridDispatch]setsevent[kIsBeingDispatched] = truebefore the listener loop and clears it after the loop finishes, but it also clearedarg[kIsBeingDispatched] = falseinside the loop right after invoking each listener.As a result, only the first listener saw the event as being dispatched. Any second or later listener observed
event.currentTarget === null,event.eventPhase === Event.NONE(0), an emptyevent.composedPath(), and could mutate the event withinitEvent()or re-dispatch it withoutERR_EVENT_RECURSION:This removes the premature reset inside the loop and wraps the loop in
try/finallysokIsBeingDispatchedis always cleared when dispatch exits, even if aonce-listener removal hook ([kRemoveListener]) throws.Note (
semver-major): re-dispatching the same event synchronously or callinginitEvent()from a second or later listener now throwsERR_EVENT_RECURSIONor is ignored, respectively, matching the first listener and the WHATWG DOM spec.Refs: https://dom.spec.whatwg.org/#concept-event-dispatch