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