blob: 4c038a66fff91458b9932adc2d3cacc8e3ac1121 [file] [log] [blame]
function assert(b) {
if (!b)
throw new Error("bad!");
}
function returnEmptyString() {
function helper(r, s) {
// I'm paranoid about RegExp matching constant folding.
return s.match(r)[1];
}
noInline(helper);
return helper(/(b*)fo/, "fo");
}
noInline(returnEmptyString);
function lower(a) {
return a.toLowerCase();
}
noInline(lower);
for (let i = 0; i < 10000; i++) {
let notRope = returnEmptyString();
assert(!notRope.length);
assert(!isRope(notRope));
lower(notRope);
}