Skip to content

Commit

Permalink
Remove entry settings object usage in the WebSocket constructor
Browse files Browse the repository at this point in the history
This matches implementations, and helps with #1431.

Also, slightly modernize the algorithm.
  • Loading branch information
domenic authored May 6, 2021
1 parent 2f69571 commit 083c65c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -97646,8 +97646,9 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {

<div w-nodev>

<p>The <dfn constructor for="WebSocket"><code data-x="dom-WebSocket">WebSocket(<var>url</var>,
<var>protocols</var>)</code></dfn> constructor, when invoked, must run these steps:</p>
<p>The <dfn constructor for="WebSocket" data-lt="WebSocket(url, protocols)"><code
data-x="dom-WebSocket">new WebSocket(<var>url</var>, <var>protocols</var>)</code></dfn>
constructor steps are:</p>

<ol>
<li><p>Let <var>urlRecord</var> be the result of applying the <span>URL parser</span> to
Expand All @@ -97672,13 +97673,19 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
<cite>The WebSocket protocol</cite>, then throw a <span>"<code>SyntaxError</code>"</span>
<code>DOMException</code>. <ref spec=WSP></p></li>

<li><p>Set <span>this</span>'s <span data-x="concept-websocket-url">url</span> to
<var>urlRecord</var>.</p></li>

<li><p>Let <var>client</var> be <span>this</span>'s <span>relevant settings
object</span>.</p></li>

<li>
<p>Run this step <span>in parallel</span>:</p>

<ol>
<li>
<p><span data-x="concept-websocket-establish">Establish a WebSocket connection</span> given
<var>urlRecord</var>, <var>protocols</var>, and the <span>entry settings object</span>. <ref
<var>urlRecord</var>, <var>protocols</var>, and <var>client</var>. <ref
spec=FETCH></p>

<p class="note">If the <span data-x="concept-websocket-establish">establish a WebSocket
Expand All @@ -97691,9 +97698,6 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
</li>
</ol>
</li>

<li><p>Return a new <code>WebSocket</code> object whose <span
data-x="concept-websocket-url">url</span> is <var>urlRecord</var>.</p></li>
</ol>

<hr>
Expand Down

0 comments on commit 083c65c

Please sign in to comment.