From 18ac7d40c87b380ce5ed617bd7c59e344730a883 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Thu, 21 Jan 2021 16:44:48 +0900 Subject: fix(runtime): fix recursive dispatches of unload event (#9207) --- cli/tests/078_unload_on_exit.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli/tests/078_unload_on_exit.ts') diff --git a/cli/tests/078_unload_on_exit.ts b/cli/tests/078_unload_on_exit.ts index e8288ef31..43d33eb25 100644 --- a/cli/tests/078_unload_on_exit.ts +++ b/cli/tests/078_unload_on_exit.ts @@ -1,4 +1,9 @@ window.onunload = () => { console.log("onunload is called"); + // This second exit call doesn't trigger unload event, + // and therefore actually stops the process. + Deno.exit(1); + console.log("This doesn't show up in console"); }; +// This exit call triggers the above unload event handler. Deno.exit(0); -- cgit v1.2.3