blob: 5c8645e2face9fded924037ad456864175966a2c [file] [edit]
function makeString(len, ch) {
let s = "";
for (let i = 0; i < len; ++i)
s += ch;
return s;
}
function test(arr, key) {
return arr.indexOf(key);
}
noInline(test);
let arr = [];
for (let i = 0; i < 64; ++i)
arr.push(String.fromCharCode(65 + (i % 26)) + makeString(3, "x"));
let key = "@" + makeString(3, "x");
let result = 0;
for (let i = 0; i < 5e4; ++i)
result += test(arr, key);
if (result !== -5e4)
throw new Error("bad result: " + result);