2 <script src="../fast/js/resources/js-test-pre.js"></script>
5 'This tests that string replacement with a large replacement string causes an out-of-memory exception. See <a href="https://bugs.webkit.org/show_bug.cgi?id=102956">bug 102956</a> for more details.'
8 function createStringWithRepeatedChar(c, multiplicity) {
9 while (c.length < multiplicity)
11 c = c.substring(0, multiplicity);
17 x = createStringWithRepeatedChar(x, 1 << 12);
18 y = createStringWithRepeatedChar(y, (1 << 20) + 1);
20 shouldThrow("x.replace(/\\d/g, y)", '"Error: Out of memory"');
21 var successfullyParsed = true;