From ffa2b0fd5153b3848103084be5a512c598c8fb03 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 4 Nov 2024 11:31:25 +0100 Subject: [PATCH] web/polyfill: fix iterator map polyfill --- web/src/util/polyfill.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/util/polyfill.js b/web/src/util/polyfill.js index 503c4f3..931a449 100644 --- a/web/src/util/polyfill.js +++ b/web/src/util/polyfill.js @@ -14,8 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -if (!Iterator.prototype.map) { - Iterator.prototype.map = function(callbackFn) { +if (!window.Iterator?.prototype.map) { + (new Map([])).__proto__.map = function(callbackFn) { const output = [] let i = 0 for (const item of this) {