test_webassembly_compile_worker_terminate.js (283B)
1 const sampleURL = "test_webassembly_compile_sample.wasm"; 2 3 function spawnWork() { 4 const N = 50; 5 var arr = []; 6 for (var i = 0; i < N; i++) { 7 arr.push(WebAssembly.compileStreaming(fetch(sampleURL))); 8 } 9 Promise.all(arr).then(spawnWork); 10 } 11 12 spawnWork(); 13 postMessage("ok");