summaryrefslogtreecommitdiff
path: root/test/binaryen.js/hello-world.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js/hello-world.js')
-rw-r--r--test/binaryen.js/hello-world.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/binaryen.js/hello-world.js b/test/binaryen.js/hello-world.js
index 03cfb4163..82867f53c 100644
--- a/test/binaryen.js/hello-world.js
+++ b/test/binaryen.js/hello-world.js
@@ -1,3 +1,6 @@
+function assert(x) {
+ if (!x) throw 'error!';
+}
// "hello world" type example: create a function that adds two i32s and
// returns the result
@@ -38,6 +41,7 @@ console.log('optimized:\n\n' + module.emitText());
var binary = module.emitBinary();
console.log('binary size: ' + binary.length);
console.log();
+assert(module.validate());
// We don't need the Binaryen module anymore, so we can tell it to
// clean itself up