diff options
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r-- | runtime/js/99_main.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index ae0de3937..e96482ba2 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -581,7 +581,6 @@ delete Object.prototype.__proto__; defineEventHandler(window, "error"); defineEventHandler(window, "load"); defineEventHandler(window, "unload"); - const isUnloadDispatched = SymbolFor("isUnloadDispatched"); // Stores the flag for checking whether unload is dispatched or not. // This prevents the recursive dispatches of unload events. @@ -682,6 +681,11 @@ delete Object.prototype.__proto__; defineEventHandler(self, "message"); defineEventHandler(self, "error", undefined, true); + // `Deno.exit()` is an alias to `self.close()`. Setting and exit + // code using an op in worker context is a no-op. + os.setExitHandler((_exitCode) => { + workerClose(); + }); runtimeStart( runtimeOptions, |