Files
scriptc/tests
Chris Tate 93d2797bac Version charAt loops and compare characters as code units
`for (let i = 0; i < s.length; i++) if (s[i] === " ") n++` and the same
loop over `s.charAt(i)` got no loop version: `s[i]` lowers to charAt,
and the version covered only charCodeAt reads. Each character paid the
inline helper's ASCII and bounds tests and kept its opaque fallback.
`const c = s[i]; if (c >= "a" && c <= "z") n++` also built the
character string and compared strings twice.

- The typed-array loop version covers `s.charAt(index)` like
  `s.charCodeAt(index)`, and a counted loop that reads either at its
  counter takes an integer counter. In the fast copy, a charAt used as a
  string is the immortal one-character string for its byte, and the
  equality and switch rewrites to charCodeAt read the byte.
- A comparison of `s.charAt(i)` with a one-unit literal compares the
  code unit, as the equality does. An index out of range reads "",
  which is below every one-unit literal; its unit read is NaN, which the
  unordered predicates count as below.
- A const string local initialized from a one-argument charAt and used
  only in one-unit equalities, comparisons and switches holds the code
  unit instead (char-unit-locals.ts).
2026-10-22 19:22:20 -05:00
..
…
2026-10-22 17:39:40 -05:00
2026-10-20 17:56:44 -05:00