Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/events/event-global-set-before-handleEvent-lookup.window.html - WPT Dashboard Interop Dashboard
test(() => {
const eventTarget = new EventTarget;
let currentEvent;
eventTarget.addEventListener("foo", {
get handleEvent() {
currentEvent = window.event;
return () => {};
}
});
const event = new Event("foo");
eventTarget.dispatchEvent(event);
assert_equals(currentEvent, event);
}, "window.event is set before 'handleEvent' lookup");