blob: ce35d729e2b41cdd349d96135c07efdf165cde73 [file] [log] [blame]
<p>Tests a crash in the regular expression engine.
If this stops with a single "regular expression too large" exception, then the test succeeded.</p>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
var string = "";
for (i = 0; i < 1000; ++i) // >
string += "[[**]]";
for (; i < 10000; ++i) { // >
string += "[[**]]";
try {
new RegExp(string);
} catch (exception) {
if (/too large/.test(exception)) {
document.writeln("<div>Got up to iteration " + i + " and then got this exception: " + exception + ".</div>");
break;
}
}
}
</script>