from-async-oom.js (464B)
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 ignoreUnhandledRejections(); 24 oomTest(test);