1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00
denoland-deno/tests/testdata/run/onload/nest_imported.ts

12 lines
408 B
TypeScript
Raw Normal View History

import { assert } from "@std/assert";
2019-10-02 11:32:51 -04:00
const handler = (e: Event) => {
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
2019-10-02 11:32:51 -04:00
console.log(`got ${e.type} event in event handler (nest_imported)`);
};
globalThis.addEventListener("load", handler);
globalThis.addEventListener("beforeunload", handler);
globalThis.addEventListener("unload", handler);
2019-07-16 00:19:26 -04:00
console.log("log from nest_imported script");