Skip to content

Commit

Permalink
Fix access of muted errors flag in "report an error"
Browse files Browse the repository at this point in the history
Changes "report an error" to check that the argument script is
a classic script before accessing its muted errors field, which is
not defined for other kinds of scripts.

Also applies the change to HostPromiseRejectionTracker.

Fixes whatwg#7501.
  • Loading branch information
takikawa committed Jan 20, 2022
1 parent 72caa31 commit a1c4754
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -93240,9 +93240,10 @@ document.querySelector("button").addEventListener("click", bound);
multiple lines.</p>
</li>

<li><p>If <var>script</var>'s <span>muted errors</span> is true, then set <var>message</var> to
"<code data-x="">Script error.</code>", <var>urlString</var> to the empty string, <var>line</var>
and <var>col</var> to 0, and <var>errorValue</var> to null.</p></li>
<li><p>If <var>script</var> is a <span>classic script</span> and <var>script</var>'s <span>muted
errors</span> is true, then set <var>message</var> to "<code data-x="">Script error.</code>",
<var>urlString</var> to the empty string, <var>line</var> and <var>col</var> to 0, and
<var>errorValue</var> to null.</p></li>

<li><p>Let <var>notHandled</var> be true.</p></li>

Expand Down Expand Up @@ -93450,7 +93451,8 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<ol>
<li><p>Let <var>script</var> be the <span>running script</span>.</p></li>

<li><p>If <var>script</var>'s <span>muted errors</span> is true, terminate these steps.</p></li>
<li><p>If <var>script</var> is a <span>classic script</span> and <var>script</var>'s <span>muted
errors</span> is true, terminate these steps.</p></li>

<li><p>Let <var>settings object</var> be <var>script</var>'s <span>settings object</span>.</p>
</li>
Expand Down

0 comments on commit a1c4754

Please sign in to comment.