Debian Codegraph @

js/src/jit-test/tests/arrays/from-async-oom.js

raw
1 // Basic Smoke Test
2 async function* asyncGen(n) {
3 for (let i = 0; i < n; i++) {
4 yield i * 2;
5 }
6 }
7
8 function test() {
9 Array.fromAsync(asyncGen(4)).then((x) => {
10 assertEq(Array.isArray(x), true);
11 assertEq(x.length, 4);
12 assertEq(x[0], 0);
13 assertEq(x[1], 2);
14 assertEq(x[2], 4);
15 assertEq(x[3], 6);
16 done = true;
17 }
18 );
19
20 drainJobQueue();
21 }
22
23 oomTest(test);
24