diff options
Diffstat (limited to 'test/binaryen.js/emit_asmjs.js')
-rw-r--r-- | test/binaryen.js/emit_asmjs.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/binaryen.js/emit_asmjs.js b/test/binaryen.js/emit_asmjs.js index 9d5a3966d..751712592 100644 --- a/test/binaryen.js/emit_asmjs.js +++ b/test/binaryen.js/emit_asmjs.js @@ -2,12 +2,16 @@ 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()); + console.log(module.emitAsmjs()); +} + +Binaryen.ready.then(test); |