mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Ignore MessagePort.start() on already-closed port
This matches other browsers, and fixes an assertion found by Domato.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
PASS (didn't crash)
|
||||
@@ -0,0 +1,10 @@
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let channel = new MessageChannel();
|
||||
let port = channel.port2;
|
||||
port.close();
|
||||
port.start();
|
||||
println("PASS (didn't crash)");
|
||||
});
|
||||
</script>
|
||||
@@ -364,6 +364,9 @@ void MessagePort::post_message_task_steps(SerializedTransferRecord& serialize_wi
|
||||
// https://html.spec.whatwg.org/multipage/web-messaging.html#dom-messageport-start
|
||||
void MessagePort::start()
|
||||
{
|
||||
if (!is_entangled())
|
||||
return;
|
||||
|
||||
VERIFY(m_socket);
|
||||
VERIFY(m_fd_passing_socket);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user