From 247ee022995131cd776ed614f305d53bb67f2a50 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 25 Jan 2026 13:22:52 +0100 Subject: [PATCH] Remove the `Promise.try()` polyfill (During rebasing of the previous patches I happened to look at the polyfills and noticed that this one could be removed now.) Note: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try#browser_compatibility - https://bugzilla.mozilla.org/show_bug.cgi?id=1928493 --- src/shared/util.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/shared/util.js b/src/shared/util.js index b50819976..0ce631435 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -1260,19 +1260,6 @@ function fromBase64Util(str) { return stringToBytes(atob(str)); } -// TODO: Remove this once https://bugzilla.mozilla.org/show_bug.cgi?id=1928493 -// is fixed. -if ( - (typeof PDFJSDev === "undefined" || PDFJSDev.test("SKIP_BABEL")) && - typeof Promise.try !== "function" -) { - Promise.try = function (fn, ...args) { - return new Promise(resolve => { - resolve(fn(...args)); - }); - }; -} - // TODO: Remove this once the `javascript.options.experimental.math_sumprecise` // preference is removed from Firefox. if (typeof Math.sumPrecise !== "function") {