diff options
Diffstat (limited to 'js/src/tests/non262/String/two-length-nonlatin-indexOf.js')
-rw-r--r-- | js/src/tests/non262/String/two-length-nonlatin-indexOf.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/tests/non262/String/two-length-nonlatin-indexOf.js b/js/src/tests/non262/String/two-length-nonlatin-indexOf.js new file mode 100644 index 0000000000..38a2e7fbe7 --- /dev/null +++ b/js/src/tests/non262/String/two-length-nonlatin-indexOf.js @@ -0,0 +1,11 @@ +var BUGNUMBER = 1801690; +var summary = "indexOf function doesn't work correctly with polish letters"; + +// Prior to this bug being fixed, this would return 0. This is because 'ł' +// truncates to the same 8-bit number as 'B'. We had a guard on the first +// character, but there was a hole in our logic specifically for the +// second character of the needle string. +assertEq("AB".indexOf("Ał"), -1); + +if (typeof reportCompare === "function") + reportCompare(true, true); |