| <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> |