Skip to content

Unneded functions renaming, keepNames and polyfills #1147

@zloirock

Description

@zloirock

I tried to move the building process of core-js to esbuild and found unneeded renaming of some function names.

This renaming is definitely unneeded since functions with the same names are defined in disjoint closures.

The keepNames option can't be applied here since in many old engines we can't redefine functions .name property - it throws an error.

It can't be prevented anyway in case of polyfilling and usage of polyfilled features in one bundle.

And it's dangerous. Even if core-js will not use esbuild for bundling by itself, someone will bundle projects with core-js - it's used on most websites. core-js polyfills many fundamental builtins and after this renaming, for example, Number.name will be "Number2" - I remember some libraries which it will break.

Metadata

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