This notice is misleading .close()
is not deprecated at all.
What happens here is that in the specs WorkerGlobalScope
is an interface that is used by different worker types (DedicatedWorkers, ServiceWorkers, SharedWorkers, and maybe other Worklets in other specs).
All these types don't have a .close
method (e.g ServiceWorkers don't), and thus this method has been moved to each specific types of worker global scope's definition.
For instance you can see that for the DedicatedWorkerGlobalScope, it's still here, and isn't scheduled to be deprecated any time soon.
And it's actually also there in MDN.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…