blob: 75171259288545d890f03df35914e21af1a7a97d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
function assert(x) {
if (!x) throw 'error!';
}
function test() {
var module = new Binaryen.Module();
module.addFunction("main", Binaryen.i32, Binaryen.i32, [], module.local.get(0, Binaryen.i32));
module.addFunctionExport("main", "main");
assert(module.validate()); // should validate before calling emitAsmjs
console.log(module.emitAsmjs());
}
Binaryen.ready.then(test);
|