mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
fix: prevent Deno.exit to fail when dispatchEvent tampered (#14665)
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
0a96cb62a8
commit
e7c894e8f5
3 changed files with 12 additions and 1 deletions
|
@ -8,6 +8,8 @@
|
|||
SymbolFor,
|
||||
} = window.__bootstrap.primordials;
|
||||
|
||||
const windowDispatchEvent = window.dispatchEvent.bind(window);
|
||||
|
||||
function loadavg() {
|
||||
return core.opSync("op_loadavg");
|
||||
}
|
||||
|
@ -51,7 +53,7 @@
|
|||
if (!window[SymbolFor("isUnloadDispatched")]) {
|
||||
// Invokes the `unload` hooks before exiting
|
||||
// ref: https://github.com/denoland/deno/issues/3603
|
||||
window.dispatchEvent(new Event("unload"));
|
||||
windowDispatchEvent(new Event("unload"));
|
||||
}
|
||||
|
||||
if (exitHandler) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue