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 <graham.lowe@gmail.com>
Co-authored-by: Graham Lowe <graham.lowe@gmail.com>
This commit is contained in:
Graham Lowe 2025-05-05 03:06:32 -04:00 committed by GitHub
parent 5051d52796
commit 21df8b875b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -338,10 +338,6 @@ impl MessagePortMethods<crate::DomTypeHolder> for MessagePort {
/// <https://html.spec.whatwg.org/multipage/#dom-messageport-close>
fn Close(&self, can_gc: CanGc) {
if self.detached.get() {
return;
}
// Set this's [[Detached]] internal slot value to true.
self.detached.set(true);