mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-09 16:32:50 +08:00
An array or typed-array index that is an exact integer or NaN, such as an element read that may miss (`t[i]!`), a `charCodeAt`, or a sum of those, is a valid index when it is ordered and below the length. The index check now tests that with one ordered compare and the integer, taken from the value's 32-bit view or from one conversion, instead of converting the index back to a double and comparing it. Number locals that are declared once with an initializer, are not captured or boxed, and are only written such values carry the same fact, so `const c = t[i]!; table[c]` and `(h * 31 + c) | 0` take the integer paths that the inline read already takes.