summaryrefslogtreecommitdiff
path: root/test/binaryen.js
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/binaryen.js
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/binaryen.js')
-rw-r--r--test/binaryen.js/exception-handling.js4
-rw-r--r--test/binaryen.js/exception-handling.js.txt6
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt12
3 files changed, 15 insertions, 7 deletions
diff --git a/test/binaryen.js/exception-handling.js b/test/binaryen.js/exception-handling.js
index b3c9974e7..3f5f6de74 100644
--- a/test/binaryen.js/exception-handling.js
+++ b/test/binaryen.js/exception-handling.js
@@ -19,7 +19,9 @@ module.setFeatures(binaryen.Features.ReferenceTypes |
var event_ = module.addEvent("e", 0, binaryen.i32, binaryen.none);
// (try
-// (throw $e (i32.const 0))
+// (do
+// (throw $e (i32.const 0))
+// )
// (catch
// ;; We don't support multi-value yet. Use locals instead.
// (local.set 0 (exnref.pop))
diff --git a/test/binaryen.js/exception-handling.js.txt b/test/binaryen.js/exception-handling.js.txt
index 99f8501a9..a2b10d37f 100644
--- a/test/binaryen.js/exception-handling.js.txt
+++ b/test/binaryen.js/exception-handling.js.txt
@@ -5,8 +5,10 @@
(func $test
(local $0 exnref)
(try
- (throw $e
- (i32.const 0)
+ (do
+ (throw $e
+ (i32.const 0)
+ )
)
(catch
(local.set $0
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 9fae467bd..976e72453 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -1758,8 +1758,10 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(try
- (throw $a-event
- (i32.const 0)
+ (do
+ (throw $a-event
+ (i32.const 0)
+ )
)
(catch
(local.set $5
@@ -3524,8 +3526,10 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(try
- (throw $a-event
- (i32.const 0)
+ (do
+ (throw $a-event
+ (i32.const 0)
+ )
)
(catch
(local.set $5