test262/implementation-contributed/javascriptcore/stress/js-fixed-array-out-of-memory.js
test262-automation e9a5a7f918 [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time) (#1620)
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
2018-07-03 15:59:58 -04:00

26 lines
629 B
JavaScript

//@ if $buildType == "debug" && !$memoryLimited then runDefault("--maxSingleAllocationSize=1048576") else skip end
var exception;
function foo() { };
function test(length) {
try {
foo([...new Array(length)].filter(() => { }));
} catch (e) {
exception = e;
}
if (exception && exception != "Error: Out of memory")
throw "ERROR: length " + length + ": unexpected exception " + exception;
}
var sizes = [
1, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000,
1000000, 5000000, 10000000, 50000000, 100000000, 500000000, 1000000000
];
for (size of sizes)
test(size);