From f88044507cb5ad8a3a27b219c7ea4e5a2d1e7207 Mon Sep 17 00:00:00 2001 From: Petka Antonov Date: Fri, 29 Nov 2019 00:53:54 +0200 Subject: [PATCH] Fixes #1627 #1623 --- src/debuggability.js | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/src/debuggability.js b/src/debuggability.js index 0c552e79f..ba49deb97 100644 --- a/src/debuggability.js +++ b/src/debuggability.js @@ -46,37 +46,10 @@ var deferUnhandledRejectionCheck; promises.length = 0; } - if (typeof document === "object" && document.createElement) { - deferUnhandledRejectionCheck = (function() { - var iframeSetTimeout; - - function checkIframe() { - if (document.body) { - var iframe = document.createElement("iframe"); - document.body.appendChild(iframe); - if (iframe.contentWindow && - iframe.contentWindow.setTimeout) { - iframeSetTimeout = iframe.contentWindow.setTimeout; - } - document.body.removeChild(iframe); - } - } - checkIframe(); - return function(promise) { - promises.push(promise); - if (iframeSetTimeout) { - iframeSetTimeout(unhandledRejectionCheck, 1); - } else { - checkIframe(); - } - }; - })(); - } else { - deferUnhandledRejectionCheck = function(promise) { - promises.push(promise); - setTimeout(unhandledRejectionCheck, 1); - }; - } + deferUnhandledRejectionCheck = function(promise) { + promises.push(promise); + setTimeout(unhandledRejectionCheck, 1); + }; es5.defineProperty(Promise, "_unhandledRejectionCheck", { value: unhandledRejectionCheck