Skip to content

Iterator cannot be polyfilled in Safari (up to 18) #1390

Open
@CreativeTechGuy

Description

When using a polyfill which depends on Iterator such as

const m = new Map();
m.keys().map(() => {}); // <- `.map` is from the Iterator protocol

As of Safari 18, it doesn't support most of the Iterator protocol. But the polyfill attempts to augment the globalThis["Iterator"] prototype, which doesn't exist in Safari (despite the compat chart saying it should). So the polyfill despite being loaded doesn't initialize and no-op.

I don't know if there is any way that this can be fixed in core-js so that these Iterator polyfills work in Safari. At the very least I hope this issue will help others not run into this.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions