1
0
Fork 0
forked from Mirrors/gomuks

web/polyfill: fix iterator map polyfill

This commit is contained in:
Tulir Asokan 2024-11-04 11:31:25 +01:00
parent b63a81ba65
commit ffa2b0fd51

View file

@ -14,8 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
if (!Iterator.prototype.map) { if (!window.Iterator?.prototype.map) {
Iterator.prototype.map = function(callbackFn) { (new Map([])).__proto__.map = function(callbackFn) {
const output = [] const output = []
let i = 0 let i = 0
for (const item of this) { for (const item of this) {