-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
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.