From 3b3b16eb00da271f7ce913778a8b92f6c0458014 Mon Sep 17 00:00:00 2001 From: CodingOnStar Date: Tue, 23 Dec 2025 14:33:57 +0800 Subject: [PATCH] feat: Add polyfill for Array.prototype.toSpliced method --- web/app/components/browser-initializer.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/app/components/browser-initializer.tsx b/web/app/components/browser-initializer.tsx index fcae22c448..3e7b3e6df1 100644 --- a/web/app/components/browser-initializer.tsx +++ b/web/app/components/browser-initializer.tsx @@ -1,5 +1,15 @@ 'use client' +// Polyfill for Array.prototype.toSpliced (ES2023, Chrome 110+) +if (!Array.prototype.toSpliced) { + // eslint-disable-next-line no-extend-native + Array.prototype.toSpliced = function (this: T[], start: number, deleteCount?: number, ...items: T[]): T[] { + const copy = this.slice() + copy.splice(start, deleteCount ?? copy.length - start, ...items) + return copy + } +} + class StorageMock { data: Record