blob: 0e9889ea0e2c0dce9e0a614af2981bd9b79d4177 [file] [log] [blame]
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 RangeError: Out of memory.
PASS s = "a"; while (1) { s += ("a" + s); } threw exception RangeError: Out of memory.
PASS s = "a"; while (1) { s = [s, s].join(); } threw exception RangeError: 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