mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
A class's constructor and methods are analyzed in receiver contexts rooted at each member. Inside a per-site clone of the function that declares the class, they resolved that function's bindings in the default context: their writes through captured variables were lost, and reads of the written objects folded to stale literals. A function with a class declaration or expression anywhere inside is no longer cloned per site. The static-tables case adds a factory whose class method writes the factory's object at initialization. It prints Node's `1,1,1` (it printed `1,1,0`), and the count of constant reads stays at 8. zod3's report is unchanged: 180 constant objects and 360 foldable reads.