From b98a872b13fbe05fd7edf898b8182842d0b00fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Buscht=C3=B6ns?= Date: Sun, 6 Dec 2020 10:12:12 +0100 Subject: [PATCH] Fix browser compatibility (#18) --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0a363ec..76a0795 100644 --- a/index.js +++ b/index.js @@ -22,7 +22,7 @@ const pTimeout = (promise, milliseconds, fallback, options) => new Promise((reso ...options }; - const timer = options.customTimers.setTimeout(() => { + const timer = options.customTimers.setTimeout.call(undefined, () => { if (typeof fallback === 'function') { try { resolve(fallback()); @@ -49,7 +49,7 @@ const pTimeout = (promise, milliseconds, fallback, options) => new Promise((reso } catch (error) { reject(error); } finally { - options.customTimers.clearTimeout(timer); + options.customTimers.clearTimeout.call(undefined, timer); } })(); });