From 3e62fbe7d42b7ab1ec54818a1491cb0107dd828a Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Fri, 25 Mar 2022 05:59:14 +0300 Subject: [PATCH] fix: setImmediate and setTimeout issues (#293) --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 6250df9..85689c8 100644 --- a/src/index.js +++ b/src/index.js @@ -239,7 +239,11 @@ var enqueuePostPromiseJob = process.nextTick(fn); }); } : - setImmediate || setTimeout; + typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeout(fn); + }; // Private: cached resolved Promise instance var resolvedPromise;