We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ce2453 commit f57fc80Copy full SHA for f57fc80
1 file changed
src/shared/util.js
@@ -1237,6 +1237,20 @@ const makeArr = () => [];
1237
const makeMap = () => new Map();
1238
const makeObj = () => Object.create(null);
1239
1240
+// TODO: Remove this once Firefox 140 is no longer supported.
1241
+if (
1242
+ (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) &&
1243
+ typeof Map.prototype.getOrInsertComputed !== "function"
1244
+) {
1245
+ // eslint-disable-next-line no-extend-native
1246
+ Map.prototype.getOrInsertComputed = function (key, callbackFn) {
1247
+ if (!this.has(key)) {
1248
+ this.set(key, callbackFn(key));
1249
+ }
1250
+ return this.get(key);
1251
+ };
1252
+}
1253
+
1254
// See https://developer.mozilla.org/en-US/docs/Web/API/Blob/bytes#browser_compatibility
1255
if (
1256
typeof PDFJSDev !== "undefined" &&
0 commit comments