mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
String.prototype.indexOf took its byte-search fast path on a proven-ASCII receiver only when the start index was not positive. A positive start went through the general path: ToIntegerOrInfinity, the surrogate-needle check, and UTF-16 to byte conversions in both directions, although byte offsets are UTF-16 indexes in an ASCII string. The fast path now covers every start index: a positive start truncates and clamps to the length, where only the empty needle is found, and the search runs from that byte offset.