Remove the Map.prototype.getOrInsertComputed polyfill from the scripting implementation (PR 21399 follow-up)

All unit- and integration-tests pass with this patch, and according to the QuickJS changelog this is supported now; note 3d5e064e9d/Changelog (L10) and https://github.com/tc39/proposal-upsert.
This commit is contained in:
Jonas Jenwald 2026-06-08 11:48:42 +02:00
parent 52a44a68be
commit 5f83408099

View File

@ -31,20 +31,6 @@ function serializeError(error) {
const makeArr = () => [];
const makeMap = () => new Map();
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
// TODO: Remove this once `Map.prototype.getOrInsertComputed` is supported in
// QuickJS.
if (typeof Map.prototype.getOrInsertComputed !== "function") {
// eslint-disable-next-line no-extend-native
Map.prototype.getOrInsertComputed = function (key, callbackFn) {
if (!this.has(key)) {
this.set(key, callbackFn(key));
}
return this.get(key);
};
}
}
export {
FORMS_VERSION,
makeArr,