11cb0ef41Sopenharmony_ci// https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke (steps 8.2 - 12) 21cb0ef41Sopenharmony_ci// https://webidl.spec.whatwg.org/#call-a-user-objects-operation (step 10.1) 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_citest(() => { 51cb0ef41Sopenharmony_ci const eventTarget = new EventTarget; 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci let currentEvent; 81cb0ef41Sopenharmony_ci eventTarget.addEventListener("foo", { 91cb0ef41Sopenharmony_ci get handleEvent() { 101cb0ef41Sopenharmony_ci currentEvent = window.event; 111cb0ef41Sopenharmony_ci return () => {}; 121cb0ef41Sopenharmony_ci } 131cb0ef41Sopenharmony_ci }); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci const event = new Event("foo"); 161cb0ef41Sopenharmony_ci eventTarget.dispatchEvent(event); 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_ci assert_equals(currentEvent, event); 191cb0ef41Sopenharmony_ci}, "window.event is set before 'handleEvent' lookup"); 20