@@ -203,6 +203,7 @@ func_type: ( type <var> )? <param>* <result>*
203
203
global_type: <val_type> | ( mut <val_type> )
204
204
table_type: <nat> <nat>? <ref_type>
205
205
memory_type: <nat> <nat>?
206
+ tag_type: ( type <var> )? <param>*
206
207
207
208
num: <int> | <float>
208
209
var: <nat> | <name>
@@ -231,6 +232,8 @@ expr:
231
232
( loop <name>? <block_type> <instr>* )
232
233
( if <name>? <block_type> ( then <instr>* ) ( else <instr>* )? )
233
234
( if <name>? <block_type> <expr>+ ( then <instr>* ) ( else <instr>* )? ) ;; = <expr>+ (if <name>? <block_type> (then <instr>*) (else <instr>*)?)
235
+ ( try <name>? <block_type> ( do <instr>* ) ( catch <instr>* )* ( catch_all <instr>* )? )
236
+ ( try <name>? <block_type> ( do <instr>* ) ( delegate <var> ) )
234
237
235
238
instr:
236
239
<expr>
@@ -239,6 +242,9 @@ instr:
239
242
loop <name>? <block_type> <instr>* end <name>? ;; = (loop <name>? <block_type> <instr>*)
240
243
if <name>? <block_type> <instr>* end <name>? ;; = (if <name>? <block_type> (then <instr>*))
241
244
if <name>? <block_type> <instr>* else <name>? <instr>* end <name>? ;; = (if <name>? <block_type> (then <instr>*) (else <instr>*))
245
+ try <name>? <block_type> <instr>* (catch <name>? <instr>*)* (catch_all <name>? <instr>*)? end <name>?
246
+ ;; = (try <name>? <block_type> (do <instr>*) (catch <instr>*)* (catch_all <instr>*)?)
247
+ try <name>? <block_type> <instr>* delegate <var> ;; = (try <name>? <block_type> (do <instr>*) (delegate <var>))
242
248
243
249
op:
244
250
unreachable
279
285
ref.null <ref_kind>
280
286
ref.is_null <ref_kind>
281
287
ref.func <var>
288
+ throw <tag_type>
289
+ rethrow <var>
282
290
<num_type>.const <num>
283
291
<num_type>.<unop>
284
292
<num_type>.<binop>
@@ -404,6 +412,7 @@ assertion:
404
412
( assert_return <action> <result>* ) ;; assert action has expected results
405
413
( assert_trap <action> <failure> ) ;; assert action traps with given failure string
406
414
( assert_exhaustion <action> <failure> ) ;; assert action exhausts system resources
415
+ ( assert_exception <action> ) ;; assert action throws an exception
407
416
( assert_malformed <module> <failure> ) ;; assert module cannot be decoded with given failure string
408
417
( assert_invalid <module> <failure> ) ;; assert module is invalid with given failure string
409
418
( assert_unlinkable <module> <failure> ) ;; assert module fails to link
@@ -495,6 +504,7 @@ assertion:
495
504
( assert_return <action> <result>* ) ;; assert action has expected results
496
505
( assert_trap <action> <failure> ) ;; assert action traps with given failure string
497
506
( assert_exhaustion <action> <failure> ) ;; assert action exhausts system resources
507
+ ( assert_exception <action> ) ;; assert action throws an exception
498
508
( assert_malformed <module> <failure> ) ;; assert module cannot be decoded with given failure string
499
509
( assert_invalid <module> <failure> ) ;; assert module is invalid with given failure string
500
510
( assert_unlinkable <module> <failure> ) ;; assert module fails to link
0 commit comments