blob: 8661705615f8567e5195e608c097406f3a125dda [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 != "Error: Out of memory")
throw "FAIL";