fix(cli): dispatch unload on exit (#9088)

This commit is contained in:
Yoshiya Hinosawa 2021-01-12 19:32:58 +09:00 committed by GitHub
parent 5c6ab75de1
commit fd56fa89f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 0 deletions

View file

@ -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");
}