d = false;
  target.addEventListener("click", () => {
    assert_equals(window.event, "foo", "Still set during dispatch");
    fired = true;
  });

  target.dispatchEvent(clickEvent);
  assert_equals(window.event, "foo", "still set after dispatch");
  assert_true(fired);
}, "Dispatching does not affect window.event after it's been replaced");
</script>
