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
Follow-ups to #9413 (PR #9465), which added the class-side source registry (Module::class_source_text). Three smaller identity gaps remain, grouped because they share the fix surface:
Object-literal accessor .name is "" where node gives "get g" / "set s". Class accessors are correct ("get p"), so the NamedEvaluation prefixing exists — the object-literal lowering path doesn't call it.
.cts NamedEvaluation gaps, upstream of class metadata entirely: module.exports = class {} gets .name === "__perry_cjs_default__" from the pre-parse source rewrite (cjs_wrap/hoist_classes.rs:178; node: ""), and const C = class {} inside a .cts loses NamedEvaluation ("" vs "C"). The committed test_class_name_cjs_9413.cts documents both and deliberately does not assert them — un-skip those arms as part of this fix.
Verification bar
Extend the two #9413 fixtures rather than adding new ones: method/getter/setter/static-method source text through String(), .toString() and template interpolation; async and generator methods; object-literal get/set names; the two .cts arms un-skipped. All byte-compared to node, each demonstrated failing before the change.
Follow-ups to #9413 (PR #9465), which added the class-side source registry (
Module::class_source_text). Three smaller identity gaps remain, grouped because they share the fix surface:String(C.prototype.m)returnsfunction () { [native code] }; node returns the method source (m() { return 1; }). Class methods compile toperry_method_*symbols rather than closures with a registered source, so the runtime: Function.prototype.toString returns [object Object] for functions (no source reconstruction; no this brand check) #4101 closure source registry never sees them. Needs the method-side equivalent of what PR fix: staticthisis the constructor, not an instance (#9404); class .name/toString/inspect report source identity (#9413) #9465 built for classes —ast::ClassMethodspans sliced the same way. (Object-literal methodtoStringalready works — the PR'sobjmethod-toStringcontrol proves the registry is live for closures.)Object-literal accessor
.nameis""where node gives"get g"/"set s". Class accessors are correct ("get p"), so the NamedEvaluation prefixing exists — the object-literal lowering path doesn't call it..ctsNamedEvaluation gaps, upstream of class metadata entirely:module.exports = class {}gets.name === "__perry_cjs_default__"from the pre-parse source rewrite (cjs_wrap/hoist_classes.rs:178; node:""), andconst C = class {}inside a.ctsloses NamedEvaluation (""vs"C"). The committedtest_class_name_cjs_9413.ctsdocuments both and deliberately does not assert them — un-skip those arms as part of this fix.Verification bar
Extend the two #9413 fixtures rather than adding new ones: method/getter/setter/static-method source text through
String(),.toString()and template interpolation; async and generator methods; object-literal get/set names; the two.ctsarms un-skipped. All byte-compared to node, each demonstrated failing before the change.