File: emit_asmjs.js

package info (click to toggle)
binaryen 68-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 34,900 kB
  • sloc: cpp: 57,351; ansic: 3,562; python: 2,898; sh: 700; makefile: 6
file content (11 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
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.addFunctionExport("main", "main");

module.validate(); // should validate before calling emitAsmjs

console.log(module.emitAsmjs());