You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Function .name and Function.prototype.toString leak compiler internals (Made$4, __anon_class_8, [native code]) #9413
functionouter(){functioninner(){}returninner.name}// node "inner" perry ""// two classes both named Made, in different scopes: node "Made" perry "Made$4"new(classextendsError{})("m").constructor.name// node "" perry "__anon_class_8"String(classKlass{})// node "class Klass {}" perry "function Klass() { [native code] }"String(({m(){return1}}).m)// node "m() { return 1; }" perry "function () { [native code] }"
Top-level names and NamedEvaluation are correct; nested declarations and duplicate names are not, and the mangled forms (Made$4, __anon_class_8) leak the compiler's disambiguation into user-visible strings.
71 constructor.name uses in the cc bundle. Libraries routinely dispatch on constructor.name, and Function.prototype.toString is used for source reflection — both get wrong answers here rather than approximations.
Found by a differential stress-test of claude-code under perry.
Fixed by PR #9465, landed via #9472: .name reports the source name (not the Made$N disambiguation key), toString() returns real class source text via the new class-side source registry, and inspect prints [class Name]. Fixtures test_class_name_and_source_9413.ts + .cts arm. Verified on main 0a1c137d90 with a fresh build: fixture byte-identical to node --experimental-strip-types (stdout, stderr, and exit code).
Follow-ups filed: #9466 (the underlying ClassId aliasing is WRONG CODE, still live), #9468 (method source text, accessor names, .cts NamedEvaluation).
Activity
fix: static this is the constructor; class name/toString/inspect repo…
proggeramlug commentedon Sep 2, 2026
Fixed by PR #9465, landed via #9472:
.namereports the source name (not theMade$Ndisambiguation key),toString()returns real class source text via the new class-side source registry, and inspect prints[class Name]. Fixturestest_class_name_and_source_9413.ts+.ctsarm. Verified on main0a1c137d90with a fresh build: fixture byte-identical tonode --experimental-strip-types(stdout, stderr, and exit code).Follow-ups filed: #9466 (the underlying ClassId aliasing is WRONG CODE, still live), #9468 (method source text, accessor names, .cts NamedEvaluation).
test(9466): gap fixture — same-name classes at different lexical depths
fix(hir): disambiguate same-name classes per SCOPE, not per name (#9466)