The precondition for unsafeCodePointAt0 is that the string length in code units is at least 1. But the fallback version only worked for length > 2, because it always accessed index 1.
This was not caught by the test suite, because fallbacks are not used in node.js. I added a second test run to the test script that forces the use of fallbacks.
The precondition for
unsafeCodePointAt0
is that the string length in code units is at least 1. But the fallback version only worked for length > 2, because it always accessed index 1.This was not caught by the test suite, because fallbacks are not used in node.js. I added a second test run to the test script that forces the use of fallbacks.