2021-12-10 09:12:21 +11:00
|
|
|
// deno-lint-ignore-file no-window-prefix
|
2024-02-14 03:22:49 +11:00
|
|
|
import { assert } from "../../../../tests/util/std/assert/mod.ts";
|
2019-07-16 13:19:26 +09:00
|
|
|
import "./nest_imported.ts";
|
2019-10-02 17:32:51 +02:00
|
|
|
|
2021-08-05 13:08:58 +02:00
|
|
|
const handler = (e: Event) => {
|
2022-10-13 03:47:47 -05:00
|
|
|
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
|
2019-10-02 17:32:51 +02:00
|
|
|
console.log(`got ${e.type} event in event handler (imported)`);
|
|
|
|
};
|
|
|
|
|
|
|
|
window.addEventListener("load", handler);
|
2022-10-13 03:47:47 -05:00
|
|
|
window.addEventListener("beforeunload", handler);
|
2019-10-02 17:32:51 +02:00
|
|
|
window.addEventListener("unload", handler);
|
2019-07-16 13:19:26 +09:00
|
|
|
console.log("log from imported script");
|