summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2020-05-11 10:51:07 -0700
committerGitHub <noreply@github.com>2020-05-11 10:51:07 -0700
commit3de8c98b682e1347e5c50c58eaddc4b01f3e26ab (patch)
treec068fef90f72839106f6f15f48f34c12d526ef99 /test/example
parent91ec2ee5bedefc4736fcda78ae39298846aeeb41 (diff)
downloadbinaryen-3de8c98b682e1347e5c50c58eaddc4b01f3e26ab.tar.gz
binaryen-3de8c98b682e1347e5c50c58eaddc4b01f3e26ab.tar.bz2
binaryen-3de8c98b682e1347e5c50c58eaddc4b01f3e26ab.zip
Make try body start with 'do' (#2846)
In WebAssembly/exception-handling#52, We decided to put `try` bodies in a `do` clause to be more consistent with `catch`. - Before ```wast (try ... (catch ... ) ) ``` - After ```wast (try (do ... ) (catch ... ) ) ``` Another upside of this change is when there are multiple instructions within a `try` body, we no longer need to wrap them in a `block`.
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.c4
-rw-r--r--test/example/c-api-kitchen-sink.txt6
2 files changed, 7 insertions, 3 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index a55862c2c..572e06ace 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -305,7 +305,9 @@ void test_core() {
// Exception handling
// (try
- // (throw $a-event (i32.const 0))
+ // (do
+ // (throw $a-event (i32.const 0))
+ // )
// (catch
// ;; We don't support multi-value yet. Use locals instead.
// (local.set 0 (exnref.pop))
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 1b8960a8c..260f51066 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -1691,8 +1691,10 @@ BinaryenFeatureAll: 1023
)
)
(try
- (throw $a-event
- (i32.const 0)
+ (do
+ (throw $a-event
+ (i32.const 0)
+ )
)
(catch
(local.set $5