ladybird
ladybird copied to clipboard
LibWeb: Don't discard PostedMessage tasks when closing a worker
The spec expects postMessage()
to act as if it is invoked immediately. Since postMessage()
isn't actually invoked immediately, keep tasks with source PostedMessage
in the task queue, so that these tasks are processed. Fixes a hang when WorkerGlobalScope.close()
is called immediately after postMessage()
.
Fixes:
- https://wpt.live/workers/interfaces/WorkerGlobalScope/close/sending-messages.html
- https://wpt.live/workers/WorkerPerformanceNow.html