From a8f9ac654dce7b7b62c44d8810a8b6bf9acc7c37 Mon Sep 17 00:00:00 2001 From: Simon Rask <33556894+SimonRask@users.noreply.github.com> Date: Sun, 4 Jul 2021 17:26:38 +0200 Subject: fix: primordials in extensions/net and runtime/js (#11270) --- runtime/js/99_main.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'runtime/js/99_main.js') 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), ); } } -- cgit v1.2.3