Skip to content

Commit

Permalink
named-worker-decl can have on fail clause
Browse files Browse the repository at this point in the history
Fixes #1274
  • Loading branch information
jclark committed Mar 31, 2024
1 parent 7abbc03 commit a12e27e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -7678,7 +7678,7 @@ <h4>Workers</h4>
default-worker-init := statement*
default-worker := statement*
named-worker-decl :=
[annots] [transactional-qual] <code>worker</code> worker-name return-type-descriptor statement-block
[annots] [transactional-qual] <code>worker</code> worker-name return-type-descriptor statement-block [on-fail-clause]
worker-name := identifier
</pre>
<p>
Expand Down Expand Up @@ -9746,6 +9746,13 @@ <h4>On fail clause</h4>
regular-compound-stmt will be handled by that regular-compound-statement.
</p>
<p>
An <code>on-fail-clause</code> attached to a <code>named-worker-decl</code> is a
shorthand for a <code>named-worker-decl</code> with a statement block that is a
<code>do-stmt</code> with that <code>on-fail-clause</code>: <code>worker
<var>X</var> { <var>Y</var> } on fail <var>Z</var></code> is equivalent to
<code>worker <var>X</var> { do { <var>Y</var> } on fail <var>Z</var> }</code>.
</p>
<p>
If there is a <code>typed-binding-pattern</code>, then it is matched to the
associated error value, binding the variables occurring within the
<code>typed-binding-pattern</code>; the <code>statement-block</code> is executed
Expand Down Expand Up @@ -11684,6 +11691,7 @@ <h3>Summary of changes from 2023R1 to 2024R1</h3>
<li>It is no longer allowed for a lock statement to contain a sync-send-action or a receive-action.</li>
<li>A <code>retry</code> or <code>transaction</code> statement may now have an <code>on fail</code>
clause.</li>
<li>A named worker declaration may now have an <code>on fail</code> clause.</li>
</ol>
</section>
<section>
Expand Down

0 comments on commit a12e27e

Please sign in to comment.