Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

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");