diff options
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r-- | runtime/js/99_main.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index a72b2177b..41cd0d05b 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -20,6 +20,7 @@ delete Object.prototype.__proto__; Symbol, SymbolFor, SymbolIterator, + PromisePrototypeThen, } = window.__bootstrap.primordials; const util = window.__bootstrap.util; const eventTarget = window.__bootstrap.eventTarget; @@ -67,11 +68,13 @@ delete Object.prototype.__proto__; windowIsClosing = true; // Push a macrotask to exit after a promise resolve. // This is not perfect, but should be fine for first pass. - PromiseResolve().then(() => - FunctionPrototypeCall(timers.setTimeout, null, () => { - // This should be fine, since only Window/MainWorker has .close() - os.exit(0); - }, 0) + PromisePrototypeThen( + PromiseResolve(), + () => + FunctionPrototypeCall(timers.setTimeout, null, () => { + // This should be fine, since only Window/MainWorker has .close() + os.exit(0); + }, 0), ); } } |