blob: 6848f5f01bcb5a2ff363b53386a85df708a87e90 (
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.addExport("main", "main");
module.validate(); // should validate before calling emitAsmjs
console.log(module.emitAsmjs());
|