Skip to content

Commit

Permalink
Delay calling onComplete for inline module script parse errors
Browse files Browse the repository at this point in the history
Fixes #9864.
  • Loading branch information
domenic committed Apr 11, 2024
1 parent e2f0e63 commit f1a7962
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -106840,7 +106840,15 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Set <var>moduleScript</var>'s <span data-x="concept-script-error-to-rethrow">error to
rethrow</span> to <var>moduleScript</var>'s <span>parse error</span>.</p></li>

<li><p>Run <var>onComplete</var> given <var>moduleScript</var>.</li>
<li>
<p><span>Queue a microtask</span> to run <var>onComplete</var> given
<var>moduleScript</var>.</p>

<p class="note">We queue a microtask, instead of running <var>onComplete</var> immediately,
to match the timing of the below case where we wait on <var>loadingPromise</var> to settle.
Among other things, this lets <span>prepare the script element</span> finish setting up its
<span>steps to run when the result is ready</span>.</p>
</li>

<li><p>Return.</p></li>
</ol>
Expand Down

0 comments on commit f1a7962

Please sign in to comment.