Merge pull request #21405 from Snuffleupagus/scripting-rm-getOrInsertComputed-polyfill

Remove the `Map.prototype.getOrInsertComputed` polyfill from the scripting implementation (PR 21399 follow-up)
This commit is contained in:
calixteman 2026-06-08 17:25:47 +02:00 committed by GitHub
commit ea4fe68c01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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,