blob: cc085b62da2f1ca2ba7bdfeac9635e2d44b09e98 [file] [log] [blame]
//@ skip if $memoryLimited
//@ runFTLNoCJIT if !$memoryLimited
// This test should not crash or fail any assertions.
function shouldEqual(stepId, actual, expected) {
if (actual != expected) {
throw stepId + ": ERROR: expect " + expected + ", actual " + actual;
}
}
var exception = undefined;
arr = [null,null,null,null];
str = "xx";
try {
for (var i = 0; i < 100; ++i)
str = arr.join(str);
} catch (e) {
exception = e;
}
shouldEqual(10000, exception, "RangeError: Out of memory");
exception = undefined;
try {
str += 'x';
} catch(e) {
exception = e;
}
shouldEqual(10100, exception, undefined);