Steps to reproduce: (1) Open a tab and navigate to any URL; (2) Run the following code in the Console of Devtools: ``` new EventSource("") ``` (3) Then this code would throw a SyntaxError exception. Actual results: This code would throw a SyntaxError exception: `SyntaxError: The string did not match the expected pattern.` Expected results: As https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource says, when the URL param is an empty string, it should be parsed as a relative URL to the API's URL. In fact, Firefox works as the spec says, and Chrome has fixed this problem following the spec nowadays too.
Created attachment 430597 [details] Patch
Seems like an easy enough fix. Let's see if we already have tests that cover this.
Comment on attachment 430597 [details] Patch r=me
Created attachment 430626 [details] Patch
Looks like Yusuke already reviews, so don’t really need my review too, but I saw a review?
<rdar://problem/79189234>
r278763