blob: 19b2f7b2cf38120510b6a367d7c2f48af361c4d6 [file] [log] [blame] [edit]
function assert(x) {
if (!x) throw 'error!';
}
var module = new Binaryen.Module();
var signature = module.addFunctionType("ii", Binaryen.i32, [ Binaryen.i32 ]);
module.addFunction("main", signature, [], module.local.get(0, Binaryen.i32));
module.addFunctionExport("main", "main");
assert(module.validate()); // should validate before calling emitAsmjs
console.log(module.emitAsmjs());