(In reply to Nicolas B. Pierron [:nbp] from comment #9)
This patch does not work in JS shell test cases as worker threads seems to be continuing their work beyond the closure of the top-level Runtime, which is to me unexpected, as I would have expected the worker threads to be closed before the closure of worker threads. This causes a seg-fault while running jit-test/tests/atomics/mutual-exclusion.js test case.
The problem was that all the runtimes did the finalization, instead of just the top-level one.
I have not even checked if it would work with ref-tests, but I would expect this is a step in the right direction to get this fixed.
Feel free to take over the current patch.
Yeah, that's going to take some more work. Currently, the tests depend on having evalInWorker available, which is not implemented for the browser. I don't know if there's an easy way to make it use real web workers. I'm kind of out of my depth, but I'll do some poking at it.