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 committed May 5, 2021
1 parent 6efd0e6 commit 8ab8a30
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -97687,8 +97687,8 @@ 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"><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 @@ -97713,13 +97713,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 @@ -97732,9 +97738,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 8ab8a30

Please sign in to comment.