The Web Workers draft spec has a mechanism for politely closing Workers, sending them an onclose event to clean up. It doesn't say when it is invoked, though presumably that's each time a Worker object is destroyed, except for those already terminated explicitly. Being able to clean up after execution seems useful, we should consider implementing this.
<rdar://problem/6425819>
Safari / Webkit does not support nested workers but pass all other WPT tests related Workers close: https://wpt.fyi/results/workers?label=master&label=experimental&aligned&view=subtest&q=worker%20close ap@webkit.org - Is this needed any more or we can close this? Thanks!
This would be applicable to regular web workers too, not just nested workers. I haven't been following spec changes, but there isn't any "kill a worker" algorithm at <https://html.spec.whatwg.org/multipage/workers.html#workers>, and "close a worker" doesn't dispatch events. So looks like this doesn't exist any more.