From fd56fa89f36016a816450cd0e8df5853c66d170c Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Tue, 12 Jan 2021 19:32:58 +0900 Subject: fix(cli): dispatch unload on exit (#9088) --- runtime/js/30_os.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/js/30_os.js') diff --git a/runtime/js/30_os.js b/runtime/js/30_os.js index 74af82124..1d700b561 100644 --- a/runtime/js/30_os.js +++ b/runtime/js/30_os.js @@ -24,6 +24,9 @@ } function exit(code = 0) { + // Invokes the `unload` hooks before exiting + // ref: https://github.com/denoland/deno/issues/3603 + window.dispatchEvent(new Event("unload")); core.jsonOpSync("op_exit", { code }); throw new Error("Code not reachable"); } -- cgit v1.2.3