diff options
Diffstat (limited to 'test/binaryen.js/custom-section.js')
-rw-r--r-- | test/binaryen.js/custom-section.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/binaryen.js/custom-section.js b/test/binaryen.js/custom-section.js index f61af0096..2ecd39025 100644 --- a/test/binaryen.js/custom-section.js +++ b/test/binaryen.js/custom-section.js @@ -2,10 +2,14 @@ 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()); + assert(module.validate()); + console.log(module.emitText()); +} + +Binaryen.ready.then(test); |