blob: 5fc2bb77ddb238f9d8c568c42ae1e6fba61b5ca9 [file] [log] [blame]
// This test that the beginning of line (bol) optimization throws when we run out of stack space.
let expectedException = "SyntaxError: Invalid regular expression: regular expression too large";
function test()
{
let source = Array(50000).join("(") + /(?:^|:|,)(?:\s*\[)+/g.toString() + Array(50000).join(")");
RegExp(source);
}
try {
test();
} catch(e) {
if (e != expectedException)
throw "Expected \"" + expectedException + "\" exception, but got \"" + e + "\"";
}