summaryrefslogtreecommitdiff
path: root/test/binaryen.js/custom-section.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js/custom-section.js')
-rw-r--r--test/binaryen.js/custom-section.js18
1 files changed, 5 insertions, 13 deletions
diff --git a/test/binaryen.js/custom-section.js b/test/binaryen.js/custom-section.js
index 2ecd39025..404fe4a4a 100644
--- a/test/binaryen.js/custom-section.js
+++ b/test/binaryen.js/custom-section.js
@@ -1,15 +1,7 @@
-function assert(x) {
- if (!x) throw 'error!';
-}
+binaryen.setAPITracing(true);
+var module = new binaryen.Module();
-function test() {
- Binaryen.setAPITracing(true);
- var module = new Binaryen.Module();
+module.addCustomSection("hello", [119, 111, 114, 108, 100]);
- module.addCustomSection("hello", [119, 111, 114, 108, 100]);
-
- assert(module.validate());
- console.log(module.emitText());
-}
-
-Binaryen.ready.then(test);
+assert(module.validate());
+console.log(module.emitText());