From 21df8b875ba2a798e21665bbba9415dd175a08c5 Mon Sep 17 00:00:00 2001 From: Graham Lowe <588088+glowe@users.noreply.github.com> Date: Mon, 5 May 2025 03:06:32 -0400 Subject: [PATCH] Remove unspecified early return in MessagePort::Close (#36836) This change removes the early return in `MessagePort::Close` that occurred when the message port was detached. The [spec](https://html.spec.whatwg.org/multipage/web-messaging.html#dom-messageport-close) doesn't prescribe this behaviour for detached ports for this operation, so the early return was unnecessary. Testing: Runs ./mach test-wpt /webmessaging/ and ./mach test-wpt /streams/ Fixes: [servo-36765](https://github.com/servo/servo/issues/36765) Signed-off-by: Graham Lowe Co-authored-by: Graham Lowe --- components/script/dom/messageport.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/components/script/dom/messageport.rs b/components/script/dom/messageport.rs index d70d3139b96..d9cd6c50768 100644 --- a/components/script/dom/messageport.rs +++ b/components/script/dom/messageport.rs @@ -338,10 +338,6 @@ impl MessagePortMethods for MessagePort { /// fn Close(&self, can_gc: CanGc) { - if self.detached.get() { - return; - } - // Set this's [[Detached]] internal slot value to true. self.detached.set(true);