summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/run/onload/nest_imported.ts
blob: a942d272954e2aeb02e2b12af878929445296542 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// deno-lint-ignore-file no-window-prefix
import { assert } from "../../../../../test_util/std/testing/asserts.ts";

const handler = (e: Event) => {
  assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
  console.log(`got ${e.type} event in event handler (nest_imported)`);
};

window.addEventListener("load", handler);
window.addEventListener("beforeunload", handler);
window.addEventListener("unload", handler);
console.log("log from nest_imported script");