Skip to content

Internal build for #7470 - #7489

Merged
1 commit merged into
mainfrom
tennyson/message-event-init-null-source
Sep 23, 2026
Merged

1 commit merged into
mainfrom
tennyson/message-event-init-null-source

Conversation

@tpmmorris

Copy link
Copy Markdown

Internal build for #7470

The HTML spec declares `MessageEventSource? source = null` in
MessageEventInit, but the initializer typed source as
jsg::Optional<jsg::Ref<MessagePort>>, which rejects null with a
TypeError. Message events fired by a WebSocket or an EventSource have
a null source, so copying one with `new MessageEvent(event.type, event)`
threw. partysocket copies events that way.

Compatibility: no flag. An omitted source and a MessagePort source
behave as before; the only change is that null no longer throws. Before
79e36b4 the initializer read nothing but data, so code passing a null
source worked until then, and this restores that.
@tpmmorris
tpmmorris requested review from a team as code owners September 23, 2026 13:54
@tpmmorris
tpmmorris requested a review from cjol September 23, 2026 13:54
@ask-bonk

ask-bonk Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@jasnell jasnell closed this pull request by merging all changes into main in c3f0074 Sep 23, 2026
@jasnell
jasnell deleted the tennyson/message-event-init-null-source branch September 23, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants