mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-09 13:33:05 +08:00
String lengths and found indices are now int32 facts for the integer range analysis: runtime strings hold at most SCR_STR_MAX_CAP UTF-8 bytes, and a UTF-16 length never exceeds the UTF-8 byte length. Loops bounded by a string length therefore get integer counters, and charCodeAt at the counter counts as an integer consumer for counted-loop versioning. A charCodeAt whose index the backend holds as an exact integer calls @sc_str_char_code_at_int: on a proven-ASCII string one unsigned compare against the length rejects negative and out-of-range indices, and every other case defers to scr_str_char_code_at with the exact double.