quickjs
quickjs copied to clipboard
Worker.parent.onmessage not set to null in test_worker_module.js test
In the test 'test_worker.js', after parent thread set worker.onmesssage to null and 'terminated' the worker, the worker would still be running since its parent.onmessage was not set to null.
This does not matter in this test, since the parent thread will exit soon afterwards. However, if there were any more async operations in the parent thread, the detached worker would always be running in the background.
Thus, please consider setting parent.onmessage to null after the worker posts 'done' to its parent in this test/example.