summaryrefslogtreecommitdiff
path: root/test/binaryen.js/event.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js/event.js')
-rw-r--r--test/binaryen.js/event.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/binaryen.js/event.js b/test/binaryen.js/event.js
index ec7a0f3b1..01ef43165 100644
--- a/test/binaryen.js/event.js
+++ b/test/binaryen.js/event.js
@@ -1,3 +1,7 @@
+function assert(x) {
+ if (!x) throw 'error!';
+}
+
function cleanInfo(info) {
var ret = {};
for (var x in info) {
@@ -22,11 +26,11 @@ console.log("getEventInfo=" + JSON.stringify(cleanInfo(eventInfo)));
module.addEventExport("a-event", "a-event-exp");
module.addEventImport("a-event-imp", "module", "base", 0, vif);
-module.validate();
+assert(module.validate());
console.log(module.emitText());
module.removeExport("a-event-exp");
module.removeEvent("a-event");
-module.validate();
+assert(module.validate());
console.log(module.emitText());