blob: 6848f5f01bcb5a2ff363b53386a85df708a87e90 [file] [log] [blame] [edit]
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());