From a12e27e16019dce7010a629ac443d355e9c4685b Mon Sep 17 00:00:00 2001 From: James Clark Date: Sun, 31 Mar 2024 11:34:42 +0700 Subject: [PATCH] named-worker-decl can have `on fail` clause Fixes #1274 --- lang/spec.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lang/spec.html b/lang/spec.html index 2d921b23..be2ebaf1 100644 --- a/lang/spec.html +++ b/lang/spec.html @@ -7678,7 +7678,7 @@

Workers

default-worker-init := statement* default-worker := statement* named-worker-decl := - [annots] [transactional-qual] worker worker-name return-type-descriptor statement-block + [annots] [transactional-qual] worker worker-name return-type-descriptor statement-block [on-fail-clause] worker-name := identifier

@@ -9746,6 +9746,13 @@

On fail clause

regular-compound-stmt will be handled by that regular-compound-statement.

+An on-fail-clause attached to a named-worker-decl is a +shorthand for a named-worker-decl with a statement block that is a +do-stmt with that on-fail-clause: worker +X { Y } on fail Z is equivalent to +worker X { do { Y } on fail Z }. +

+

If there is a typed-binding-pattern, then it is matched to the associated error value, binding the variables occurring within the typed-binding-pattern; the statement-block is executed @@ -11684,6 +11691,7 @@

Summary of changes from 2023R1 to 2024R1

  • It is no longer allowed for a lock statement to contain a sync-send-action or a receive-action.
  • A retry or transaction statement may now have an on fail clause.
  • +
  • A named worker declaration may now have an on fail clause.