Files
scriptc/tests/corpus/3022-string-affix-positions.ts
Chris Tate 93af33085e Handle positioned string affix calls in static mode (#421)
* Handle positioned string affix calls in static mode

* Record preflight baselines for string affix fixtures
2026-09-25 07:58:24 -05:00

19 lines
592 B
TypeScript

const text = "a😀bc😀d";
for (const position of [NaN, -Infinity, -2, -0, 0, 1, 1.9, 2, 3, 4, 5, 6, 7, 8, Infinity]) {
console.log(
text.startsWith("a", position),
text.startsWith("😀", position),
text.startsWith("bc", position),
text.startsWith("", position),
);
console.log(
text.endsWith("a", position),
text.endsWith("😀", position),
text.endsWith("bc", position),
text.endsWith("", position),
);
}
console.log("😀".startsWith("�", 1), "😀".endsWith("�", 1));
console.log("a😀b".startsWith("b", 3), "a😀b".endsWith("😀", 3));