Implements the event dispatch infrastructure enabling JS scripts to register event listeners and respond to click events with DOM-spec-compliant bubbling. Key additions: - Function expression parsing (anonymous and named) in js_parser - Function identity via monotonic u64 IDs on JsFunction for removeEventListener - call_function_with_host on JsVm that isolates handler errors (stays Primed, never Failed) - EventListenerRegistry with addEventListener/removeEventListener deduplication - DomEvent model with preventDefault/stopPropagation support - Event dispatch algorithm: target phase + bubble phase with listener snapshots - 11 integration tests covering click handlers, bubbling, error recovery, and event properties Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
75 KiB
75 KiB