diff options
Diffstat (limited to 'test/binaryen.js/emit_asmjs.js')
-rw-r--r-- | test/binaryen.js/emit_asmjs.js | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/test/binaryen.js/emit_asmjs.js b/test/binaryen.js/emit_asmjs.js index 751712592..e7b9afee2 100644 --- a/test/binaryen.js/emit_asmjs.js +++ b/test/binaryen.js/emit_asmjs.js @@ -1,17 +1,9 @@ -function assert(x) { - if (!x) throw 'error!'; -} +var module = new binaryen.Module(); -function test() { - var module = new Binaryen.Module(); +module.addFunction("main", binaryen.i32, binaryen.i32, [], module.local.get(0, binaryen.i32)); - module.addFunction("main", Binaryen.i32, Binaryen.i32, [], module.local.get(0, Binaryen.i32)); +module.addFunctionExport("main", "main"); - module.addFunctionExport("main", "main"); +assert(module.validate()); // should validate before calling emitAsmjs - assert(module.validate()); // should validate before calling emitAsmjs - - console.log(module.emitAsmjs()); -} - -Binaryen.ready.then(test); +console.log(module.emitAsmjs()); |