blob: d7818fea30611f2f78369029dc87b8df51638eb4 [file] [log] [blame]
//@ skip if $memoryLimited
var hugeString = "x";
for (i = 0; i < 25; ++i) {
hugeString += hugeString;
}
var exception;
var weird = '';
try {
var f = new Function(hugeString, hugeString, hugeString, hugeString, hugeString, hugeString, hugeString,
hugeString, hugeString, hugeString, hugeString, hugeString, hugeString, hugeString,
hugeString, hugeString, hugeString, hugeString, hugeString, hugeString, hugeString,
() => 42,
"return 42;");
} catch (e) {
exception = e;
}
if (exception != "RangeError: Out of memory")
throw "FAIL";