Skip to content

Commit 273bc7f

Browse files
committed
Fix example that rejects promises from in parallel
Closes #10535.
1 parent 0068b12 commit 273bc7f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

source

+10-4
Original file line numberDiff line numberDiff line change
@@ -1634,14 +1634,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
16341634
<p>The following solution suffers from race conditions:</p>
16351635

16361636
<ol>
1637-
<li><p>Let <var>p</var> be a new promise.</p></li>
1637+
<li><p>Let <var>p</var> be a new promise created in <span>this</span>'s <span
1638+
data-x="concept-relevant-realm">relevant realm</span>.</p></li>
16381639

16391640
<li>
16401641
<p>Run the following steps <span>in parallel</span>:</p>
16411642

16421643
<ol>
16431644
<li><p>If <var>nameList</var> <span data-x="list contains">contains</span> <var>name</var>,
1644-
reject <var>p</var> with a <code>TypeError</code> and abort these steps.</p></li>
1645+
then <span>queue a global task</span> on the <span>DOM manipulation task source</span> given
1646+
<span>this</span>'s <span>relevant global object</span> to reject <var>p</var> with a
1647+
<code>TypeError</code>, and abort these steps.</p></li>
16451648

16461649
<li><p>Do some potentially lengthy work.</p></li>
16471650

@@ -1663,14 +1666,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
16631666
<span>starting a new parallel queue</span>, then:</p>
16641667

16651668
<ol>
1666-
<li><p>Let <var>p</var> be a new promise.</p></li>
1669+
<li><p>Let <var>p</var> be a new promise created in <span>this</span>'s <span
1670+
data-x="concept-relevant-realm">relevant realm</span>.</p></li>
16671671

16681672
<li>
16691673
<p><mark><span>Enqueue the following steps</span> to <var>nameListQueue</var>:</mark></p>
16701674

16711675
<ol>
16721676
<li><p>If <var>nameList</var> <span data-x="list contains">contains</span> <var>name</var>,
1673-
reject <var>p</var> with a <code>TypeError</code> and abort these steps.</p></li>
1677+
then <span>queue a global task</span> on the <span>DOM manipulation task source</span> given
1678+
<span>this</span>'s <span>relevant global object</span> to reject <var>p</var> with a
1679+
<code>TypeError</code>, and abort these steps.</p></li>
16741680

16751681
<li><p>Do some potentially lengthy work.</p></li>
16761682

0 commit comments

Comments
 (0)