mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-10 01:56:15 +08:00
`var a = String; a.name` printed "a". Name inference followed any const binding chain and answered the last identifier, but V8's SetFunctionName runs only for an anonymous function or class definition: every other value keeps the name it already has. The resolution now stops at a named definition, another binding or a member read, and follows only an anonymous definition's binding, which is the binding that named the function when it was created. An import alias keeps that name: `const root = (text) => text` exported from a module and imported as `builder` is still "root". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>