mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 13:44:08 +00:00
fix(cli): dispatch unload on exit (#9088)
This commit is contained in:
parent
5c6ab75de1
commit
fd56fa89f3
4 changed files with 13 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue