summaryrefslogtreecommitdiff
path: root/test/binaryen.js/expressions.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js/expressions.js')
-rw-r--r--test/binaryen.js/expressions.js46
1 files changed, 23 insertions, 23 deletions
diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js
index ca45933a7..40d4194fd 100644
--- a/test/binaryen.js/expressions.js
+++ b/test/binaryen.js/expressions.js
@@ -1565,22 +1565,22 @@ console.log("# RefEq");
console.log("# Try");
(function testTry() {
const module = new binaryen.Module();
- module.addEvent("event1", 0, binaryen.none, binaryen.none);
- module.addEvent("event2", 0, binaryen.none, binaryen.none);
- module.addEvent("event3", 0, binaryen.none, binaryen.none);
+ module.addTag("tag1", 0, binaryen.none, binaryen.none);
+ module.addTag("tag2", 0, binaryen.none, binaryen.none);
+ module.addTag("tag3", 0, binaryen.none, binaryen.none);
var body = module.i32.const(1);
var catchBodies = [
module.i32.const(2),
module.i32.const(3)
];
- const theTry = binaryen.Try(module.try('', body, ["event1"], catchBodies, ''));
+ const theTry = binaryen.Try(module.try('', body, ["tag1"], catchBodies, ''));
assert(theTry instanceof binaryen.Try);
assert(theTry instanceof binaryen.Expression);
assert(theTry.body === body);
assertDeepEqual(theTry.catchBodies, catchBodies);
assert(theTry.type === binaryen.i32);
- assert(theTry.getNumCatchEvents() == 1);
+ assert(theTry.getNumCatchTags() == 1);
assert(theTry.getNumCatchBodies() == 2);
assert(theTry.hasCatchAll() == 1);
console.log(theTry.toText());
@@ -1596,31 +1596,31 @@ console.log("# Try");
assertDeepEqual(theTry.getCatchBodies(), catchBodies);
console.log(theTry.toText());
- theTry.insertCatchEventAt(1, "event2");
+ theTry.insertCatchTagAt(1, "tag2");
theTry.insertCatchBodyAt(0, module.i32.const(6));
- assert(theTry.getNumCatchEvents() == 2);
+ assert(theTry.getNumCatchTags() == 2);
assert(theTry.getNumCatchBodies() == 2);
assert(theTry.hasCatchAll() == 0);
console.log(theTry.toText());
- assert(theTry.removeCatchEventAt(1) == "event2");
+ assert(theTry.removeCatchTagAt(1) == "tag2");
theTry.removeCatchBodyAt(1);
- assert(theTry.getNumCatchEvents() == 1);
+ assert(theTry.getNumCatchTags() == 1);
assert(theTry.getNumCatchBodies() == 1);
console.log(theTry.toText());
- theTry.appendCatchEvent("event3");
+ theTry.appendCatchTag("tag3");
theTry.appendCatchBody(module.drop(module.i32.const(7)));
- assert(theTry.getCatchEventAt(0) == "event1");
- assert(theTry.getCatchEventAt(1) == "event3");
- theTry.setCatchEvents(["event2", "event3"]);
- assertDeepEqual(theTry.getCatchEvents(), ["event2", "event3"]);
+ assert(theTry.getCatchTagAt(0) == "tag1");
+ assert(theTry.getCatchTagAt(1) == "tag3");
+ theTry.setCatchTags(["tag2", "tag3"]);
+ assertDeepEqual(theTry.getCatchTags(), ["tag2", "tag3"]);
theTry.setCatchBodies([module.i32.const(8), module.i32.const(9)]);
- assert(theTry.getCatchEventAt(0) == "event2");
- assert(theTry.getCatchEventAt(1) == "event3");
- theTry.setCatchEventAt(1, "event1");
+ assert(theTry.getCatchTagAt(0) == "tag2");
+ assert(theTry.getCatchTagAt(1) == "tag3");
+ theTry.setCatchTagAt(1, "tag1");
theTry.setCatchBodyAt(1, module.i32.const(10));
- assert(theTry.getCatchEventAt(1) == "event1");
+ assert(theTry.getCatchTagAt(1) == "tag1");
console.log(theTry.toText());
theTry.type = binaryen.f64;
@@ -1643,20 +1643,20 @@ console.log("# Throw");
(function testThrow() {
const module = new binaryen.Module();
- var event = "foo";
+ var tag = "foo";
var operands = [
module.i32.const(1),
module.i32.const(2)
];
- const theThrow = binaryen.Throw(module.throw(event, operands));
+ const theThrow = binaryen.Throw(module.throw(tag, operands));
assert(theThrow instanceof binaryen.Throw);
assert(theThrow instanceof binaryen.Expression);
- assert(theThrow.event === event);
+ assert(theThrow.tag === tag);
assertDeepEqual(theThrow.operands, operands);
assert(theThrow.type === binaryen.unreachable);
- theThrow.event = "bar";
- assert(theThrow.event === "bar");
+ theThrow.tag = "bar";
+ assert(theThrow.tag === "bar");
theThrow.operands = operands = [
module.i32.const(3), // set
module.i32.const(4), // set