| This test checks if repeated string concatenation causes an exception (and not a crash). From WebKit Bug Repeated string concatenation results in OOM crash. |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| PASS s = "a"; while (1) { s += s; } threw exception Error: Out of memory. |
| PASS s = "a"; while (1) { s += ("a" + s); } threw exception Error: Out of memory. |
| PASS s = "a"; while (1) { s = [s, s].join(); } threw exception Error: Out of memory. |
| |
| We also verify that the the string is stil functional after the out of memory exception is raised. In rdar://problem/5352887, accessing the string after the exception would crash. |
| PASS: String s was functional after expandCapacity raised out of memory exception. |
| PASS: String s was functional after expandPreCapacity raised out of memory exception. |
| PASS: String t was functional after expandPreCapacity raised out of memory exception. |
| PASS: String s was functional after append raised out of memory exception. |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |