forked from WebAssembly/wabt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtry-delegate.txt
81 lines (81 loc) · 1.9 KB
/
try-delegate.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
;;; TOOL: run-interp
;;; ARGS*: --enable-exceptions
(module
(tag $e1)
(tag $e2)
(func (export "try-delegate") (result i32)
(try $l (result i32)
(do
(try
(do (throw $e1))
(delegate $l))
(i32.const 0))
(catch $e1
(i32.const 1))))
(func (export "try-delegate-2") (result i32)
(try $l (result i32)
(do
(try
(do
(try
(do (throw $e1))
(delegate $l)))
(catch_all))
(i32.const 0))
(catch $e1
(i32.const 1))))
(func (export "try-delegate-uncaught") (result i32)
(try $l (result i32)
(do
(try
(do (throw $e1))
(delegate $l))
(i32.const 0))
(catch $e2
(i32.const 0))))
(func (export "try-delegate-to-caller") (result i32)
(try (result i32)
(do
(try
(do (throw $e1))
(delegate 1))
(i32.const 0))
(catch $e1
(i32.const 1))))
(func (export "try-delegate-to-delegate") (result i32)
(try $l1 (result i32)
(do
(try $l2
(do
(try
(do
(try
(do (throw $e1))
(delegate $l2)))
(catch_all)))
(delegate $l1))
(i32.const 0))
(catch $e1
(i32.const 1))))
(func (export "try-delegate-to-block") (result i32)
(try (result i32)
(do
(block $l
(try
(do
(try
(do (throw $e1))
(delegate $l)))
(catch_all)))
(i32.const 0))
(catch $e1
(i32.const 1))))
)
(;; STDOUT ;;;
try-delegate() => i32:1
try-delegate-2() => i32:1
try-delegate-uncaught() => error: uncaught exception
try-delegate-to-caller() => error: uncaught exception
try-delegate-to-delegate() => i32:1
try-delegate-to-block() => i32:1
;;; STDOUT ;;)