mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-13 05:31:03 +02:00
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:
commit
ea4fe68c01
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user