blob: c7cd5c717748ebad464733a952e9e0f6cd9e4eff (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
var module = new Binaryen.Module();
var signature = module.addFunctionType("ii", Binaryen.i32, [ Binaryen.i32 ]);
module.addFunction("main", signature, [], module.getLocal(0, Binaryen.i32));
module.addFunctionExport("main", "main");
module.validate(); // should validate before calling emitAsmjs
console.log(module.emitAsmjs());
|