1// https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke (steps 8.2 - 12) 2// https://webidl.spec.whatwg.org/#call-a-user-objects-operation (step 10.1) 3 4test(() => { 5 const eventTarget = new EventTarget; 6 7 let currentEvent; 8 eventTarget.addEventListener("foo", { 9 get handleEvent() { 10 currentEvent = window.event; 11 return () => {}; 12 } 13 }); 14 15 const event = new Event("foo"); 16 eventTarget.dispatchEvent(event); 17 18 assert_equals(currentEvent, event); 19}, "window.event is set before 'handleEvent' lookup"); 20