Skip to content

Commit f880445

Browse files
committedNov 28, 2019
Fixes #1627 #1623
1 parent bd20f79 commit f880445

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed
 

‎src/debuggability.js

+4-31
Original file line numberDiff line numberDiff line change
@@ -46,37 +46,10 @@ var deferUnhandledRejectionCheck;
4646
promises.length = 0;
4747
}
4848

49-
if (typeof document === "object" && document.createElement) {
50-
deferUnhandledRejectionCheck = (function() {
51-
var iframeSetTimeout;
52-
53-
function checkIframe() {
54-
if (document.body) {
55-
var iframe = document.createElement("iframe");
56-
document.body.appendChild(iframe);
57-
if (iframe.contentWindow &&
58-
iframe.contentWindow.setTimeout) {
59-
iframeSetTimeout = iframe.contentWindow.setTimeout;
60-
}
61-
document.body.removeChild(iframe);
62-
}
63-
}
64-
checkIframe();
65-
return function(promise) {
66-
promises.push(promise);
67-
if (iframeSetTimeout) {
68-
iframeSetTimeout(unhandledRejectionCheck, 1);
69-
} else {
70-
checkIframe();
71-
}
72-
};
73-
})();
74-
} else {
75-
deferUnhandledRejectionCheck = function(promise) {
76-
promises.push(promise);
77-
setTimeout(unhandledRejectionCheck, 1);
78-
};
79-
}
49+
deferUnhandledRejectionCheck = function(promise) {
50+
promises.push(promise);
51+
setTimeout(unhandledRejectionCheck, 1);
52+
};
8053

8154
es5.defineProperty(Promise, "_unhandledRejectionCheck", {
8255
value: unhandledRejectionCheck

0 commit comments

Comments
 (0)
Please sign in to comment.