summaryrefslogtreecommitdiff
path: root/runtime/js/30_os.js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js/30_os.js')
-rw-r--r--runtime/js/30_os.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/js/30_os.js b/runtime/js/30_os.js
index e8467c268..9cc2ba5c7 100644
--- a/runtime/js/30_os.js
+++ b/runtime/js/30_os.js
@@ -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) {