mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
A local captured by a closure lives in a box shared by its declaring function and every capturing closure, so the range analysis had no facts for it anywhere, not even in the declaring function. int32-slots.ts now groups the members of each box (closure captures map positionally onto the lifted function's captures) and proves the group int32 when every write to it anywhere is proven and it starts from a proven parameter or an initialized declaration; ++/--, for-of and catch bindings, TDZ boxes and class-captured bindings stay unknown. analyzeIntegerRanges reads the proof through a new boxed-binding fact. Corpus 4453 adds closures that read an int32 parameter, store a fraction into a captured local, and count past int32.