Back to Tsx

Function identity

notes/esbuild/function-identity.md

4.23.91.5 KB
Original Source

Function identity

With keepNames, esbuild inserts name-restoration calls while lowering function declarations and arrows/function expressions; the calls target a generated __name runtime helper (construction, helper).

Final symbol names are selected later by linker collision handling and the renamer (linker, renamer); disabling identifier minification does not prevent collision suffixes.

Inference: serializing a transformed function whose body contains nested name-restoration calls can leave a free __name reference because the helper remains in its enclosing module; esbuild documents transformed-function relocation through toString()/eval() as unsupported (issue).