From: Fabrice Bellard Date: Mon, 9 Nov 2026 17:16:48 +0000 (+0100) Subject: test_worker.js: explicitly terminate the worker X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=e5ac135f8db58f8d6b7b5862b8263ce6ba9c5ab6;p=quickjs.git test_worker.js: explicitly terminate the worker --- diff --git a/tests/test_worker_module.js b/tests/test_worker_module.js index df9358c..ba893f4 100644 --- a/tests/test_worker_module.js +++ b/tests/test_worker_module.js @@ -8,17 +8,13 @@ function handle_msg(e) { var ev = e.data; // print("child_recv", JSON.stringify(ev)); switch(ev.type) { - case "abort": - parent.postMessage({ type: "done" }); - parent.onmessage = null; /* terminate the worker */ - break; case "sab": /* modify the SharedArrayBuffer */ ev.buf[2] = 10; parent.postMessage({ type: "sab_done", buf: ev.buf }); break; case "wait_async": - Atomics.waitAsync(ev.buf, 0, 0, Infinity).value.then( () => { parent.postMessage({ type: "done" }); } ); + Atomics.waitAsync(ev.buf, 0, 0, Infinity).value.then( () => { parent.postMessage({ type: "done" }); parent.onmessage = null; /* terminate the worker */ }); parent.postMessage({ type: "notify", buf: ev.buf }); break; }